Improve quine printf
This commit is contained in:
parent
f1573d922d
commit
383b243ebd
1 changed files with 2 additions and 6 deletions
|
|
@ -94,18 +94,14 @@ bashrc_forward () {
|
||||||
[[ "${ENV##*/}" =~ ^[0-9]+$ ]] && builtin eval "builtin exec ${ENV##*/}<&-"
|
[[ "${ENV##*/}" =~ ^[0-9]+$ ]] && builtin eval "builtin exec ${ENV##*/}<&-"
|
||||||
|
|
||||||
#-# Constructs new ENV after every command, thanks to the quine
|
#-# Constructs new ENV after every command, thanks to the quine
|
||||||
builtin exec {ENV}< <(
|
builtin exec {ENV}< <(printf "%s\\n%s" "${_s@A}" "$_s")
|
||||||
printf %s "${_s@A}
|
|
||||||
$_s"
|
|
||||||
)
|
|
||||||
|
|
||||||
export ENV="/dev/fd/$ENV"
|
export ENV="/dev/fd/$ENV"
|
||||||
'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''
|
'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''
|
||||||
|
|
||||||
'\''\'\'''\''
|
'\''\'\'''\''
|
||||||
|
|
||||||
printf %s "${_s@A}
|
printf "%s\\n%s" "${_s@A}" "$_s"
|
||||||
$_s"
|
|
||||||
|
|
||||||
#-# Suppress the warning `bash: POSIXLY_CORRECT: readonly variable` using a one-shot DEBUG trap
|
#-# Suppress the warning `bash: POSIXLY_CORRECT: readonly variable` using a one-shot DEBUG trap
|
||||||
#-# `PS0` and `PROMPT_COMMAND` will not suffice, `PROMPT_COMMAND` runs AFTER the command, therefore
|
#-# `PS0` and `PROMPT_COMMAND` will not suffice, `PROMPT_COMMAND` runs AFTER the command, therefore
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue