Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on Bash.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/bash.e>
#           or at <http://angg.twu.net/e/bash.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######





# «.bash-debian»		(to "bash-debian")
# «.dash»			(to "dash")
# «.bash_source_old»		(to "bash_source_old")
# «.bash_source»		(to "bash_source")
# «.bashfaq»			(to "bashfaq")
# «.pipe_stdout_stderr»		(to "pipe_stdout_stderr")
# «.redirection»		(to "redirection")
# «.var_expansion»		(to "var_expansion")
# «.case»			(to "case")
# «.args_with_spaces»		(to "args_with_spaces")
# «.pdsc»			(to "pdsc")
# «.exit-code-and-if»		(to "exit-code-and-if")
# «.here-docs-verbose-mode»	(to "here-docs-verbose-mode")
# «.mailing-list»		(to "mailing-list")
# «.bash-3.1-info»		(to "bash-3.1-info")
# «.bash-3.2-info»		(to "bash-3.2-info")
# «.bash-4.1-info»		(to "bash-4.1-info")
# «.bash-doc»			(to "bash-doc")
# «.prompt»			(to "prompt")
# «.tty-var»			(to "tty-var")
# «.login-shell»		(to "login-shell")
# «.process-substitution»	(to "process-substitution")
# «.shellshock»			(to "shellshock")
# «.julio-neves»		(to "julio-neves")



# Note: I'm just learning bash now (sep/2000), and mainly to port my
# zsh scripts to it, as zsh doesn't run on the Hurd (yet)...




#####
#
# Bash on Debian
# 2011nov19
#
#####

# «bash-debian»  (to ".bash-debian")
# (find-angg ".emacs" "bash")
# (find-zsh "availabledebs | sort | grep bash")
# The Bash Manual is considered to be non-dfsg...
# I need to clean up my scripts that download and install it.
# (find-es "bash" "bash-3.1-info")
# (find-es "bash" "bashfaq")
# (code-c-d "bashfaq" "$S/ftp/ftp.cwru.edu/pub/bash/")
# (code-c-d "bashsrc" "~/usrc/bash-3.1/")

# (find-fline "~/info/" "bashref")
# (find-status   "bash")
# (find-vldifile "bash.list")
# (find-udfile   "bash/")
# (find-status   "bash-doc")
# (find-vldifile "bash-doc.list")
# (find-udfile   "bash-doc/")

# (find-bashnode "Top")

# (find-bashnode "Builtin Index")
# (find-bashnode "Reserved Word Index")
# (find-bashnode "Variable Index")
# (find-bashnode "Function Index")
# (find-bashnode "Concept Index")

# (find-udfile "bash/examples/")
# (find-udfile "bash/examples/")
# (find-udfile "bash/examples/bashdb/")
# (find-udfile "bash/examples/functions/")
# (find-udfile "bash/examples/misc/")
# (find-udfile "bash/examples/scripts/")
# (find-udfile "bash/examples/scripts.noah/")
# (find-udfile "bash/examples/scripts.v2/")
# (find-udfile "bash/examples/startup-files/")

#*
zcatinfo /usr/share/info/bash > /tmp/bash.info
#*
# (find-fline "/tmp/bash.info")




#####
#
# dash
# 2011nov19
#
#####

# «dash»  (to ".dash")
# (find-angg ".emacs" "dash")
# (find-status   "dash")
# (find-vldifile "dash.list")
# (find-udfile   "dash/")
# (find-udfile "dash/NEWS.Debian.gz")
# (find-udfile "dash/README.source")
# (find-man "1 dash")
# (find-man "1 sh")




#####
#
# bash source (woody)
# 2000sep10
#
#####

# «bash_source_old»  (to ".bash_source_old")
#*
rm -Rv /usr/src/bash-2.04/
pdsc $SDEBIAN/dists/woody/main/source/base/bash_2.04-6.dsc
cd /usr/src/bash-2.04/
#*
# (code-c-d "bash" "/usr/src/bash-2.04/" "bash")
# (find-bashfile "")
# (find-bashfile "builtins/")
# (find-bashfile "builtins/set.def" "o_options[] =" "verbose")
# (find-bashnode "")




#####
#
# bash source (3.0)
# 2007jan17
#
#####

# «bash_source»  (to ".bash_source")
# http://ftp.debian.org/debian/pool/main/b/bash/bash_3.0-14.diff.gz
# http://ftp.debian.org/debian/pool/main/b/bash/bash_3.0.orig.tar.gz
# (find-node "(tar)Writing to Standard Output" "tar -xOzf foo.tgz bigfile | process")
#*
rm -Rv ~/usrc/bash-3.0/
tar -xOzf \
    $S/http/ftp.debian.org/debian/pool/main/b/bash/bash_3.0.orig.tar.gz \
    bash-3.0.orig/bash-3.0.tar.gz \
  | tar -C ~/usrc/ -xvzf -
cd     ~/usrc/bash-3.0/

#*
# (code-c-d "bash" "~/usrc/bash-3.0/" :grep)
# (find-bashfile "")
# (find-bashgrep "grep -niH here.doc *")





#####
#
# the bash FAQ
# 2006aug03
#
#####

# «bashfaq»  (to ".bashfaq")
# The license of the FAQ is not DFSG-free:
# (find-udfile "bash/FAQ")

# Use the version from the web:
# ftp://ftp.cwru.edu/pub/bash/FAQ
# (code-c-d "bashfaq" "$S/ftp/ftp.cwru.edu/pub/bash/")
# (find-bashfaqfile "FAQ")




#####
#
# What is the bash equivalent of zsh's "|&"?
# 2000sep10
#
#####

# «pipe_stdout_stderr»  (to ".pipe_stdout_stderr")
# (find-bashnode "Redirections")
# (find-bashnode "Redirections" "2>&1")
# (find-bashnode "Redirections" "Redirecting Standard Output and Standard E")
# (find-bashnode "Pipelines")

# (find-bashnode "Redirections" "duplicate output file descriptors")
# (find-node "(zsh)Redirection")
# (find-node "(zsh)Redirection" "duplicated")
# (eeman "2 dup2")

# (find-bashnode "Invoking Bash" "`-c STRING'")

# Hey, the FAQ has a quick answer:
# (find-fline "/usr/doc/bash/FAQ.gz" "like csh does with `|&'?")
# (find-fline "/usr/doc/bash/FAQ.gz" "command 2>&1 | command2")
# (find-bashfaqfile "FAQ" "like csh does with `|&'?")
# (find-bashfaqfile "FAQ" "command 2>&1 | command2")
# zsh's     "command     |& commands"
# is bash's "command 2>&1 | command2".
#*
(echo stdout; echo stderr 1>&2)
(echo stdout; echo stderr 1>&2)  > /dev/null
(echo stdout; echo stderr 1>&2) 1> /dev/null
(echo stdout; echo stderr 1>&2) 2> /dev/null
(echo stdout; echo stderr 1>&2)      | rev
(echo stdout; echo stderr 1>&2) 2>&1 | rev
#*
{ echo stdout; echo stderr 1>&2; }
{ echo stdout; echo stderr 1>&2; }  > /dev/null
{ echo stdout; echo stderr 1>&2; } 1> /dev/null
{ echo stdout; echo stderr 1>&2; } 2> /dev/null
{ echo stdout; echo stderr 1>&2; }      | rev
{ echo stdout; echo stderr 1>&2; } 2>&1 | rev
#*




#####
#
# more on redirections
# 2006aug03
#
#####

# «redirection»  (to ".redirection")
# (find-es "busybox" "ash-redirection")
# Note: I still don't understand "1>&2 > output".
# (find-bashnode "Redirections" "[N]>>WORD")
# (find-bashnode "Redirections" "[N]>[|]WORD")
# (find-bashnode "Redirections" ">&WORD")
# (find-bashnode "Redirections" "[N]>&WORD")
# (find-bashnode "Redirections" "[N]>&DIGIT-")
#*
rm -R /tmp/red/
mkdir /tmp/red/
cd    /tmp/red/
{ echo one; echo two 1>&2 } 1> one 2> two
for i in *; do echo "$i: $(cat $i)"; done
{ echo one; echo two 1>&2 } 1>&2 1> one 2> two
for i in *; do echo "$i: $(cat $i)"; done

#*
# (find-node "(libc)Creating a Pipe")





#####
#
# variable expansion
# 2000nov17
#
#####

# «var_expansion»  (to ".var_expansion")
#*
FOO=BAR
echo $FOO
unset FOO
echo $FOO
#*

# (find-bashnode "Shell Parameter Expansion")
#*
FOO=BAR
unset BAR
VOID=
echo ${FOO:-QUUX}
echo ${BAR:-QUUX}
echo ${VOID:-QUUX}
echo $FOO
echo $BAR
echo $VOID

echo ${FOO:=QUUX}
echo ${BAR:=QUUX}
echo ${VOID:=QUUX}
echo $FOO
echo $BAR
echo $VOID

#*
# (find-bashnode "Shell Parameter Expansion" "`${PARAMETER:-WORD}'")
SET=hello
unset UNSET
VOID=

echo ${SET:-WORD}    ;# -> hello
echo ${UNSET:-WORD}  ;# -> WORD
echo ${VOID:-WORD}   ;# -> WORD

echo ${UNSET:-$SET}  ;# -> hello

#*




#####
#
# posix sh syntax
# 2000sep27
#
#####

# (find-bashnode "Bourne Shell Builtins" "`test'")
# (find-bashnode "Bash Conditional Expressions")
# (find-bashnode "Bash Conditional Expressions" "`STRING1 == STRING2'")
# (find-bashnode "Bash POSIX Mode")
# (find-bashnode "Conditional Constructs")

#*
cat > /tmp/tmp.sh <<'---'
if [ $1 == yes ]; then
  echo Yes!
elif [ $1 == no ]; then
  echo No!
else
  echo Argh!
fi
---
bash /tmp/tmp.sh yes
bash /tmp/tmp.sh no
bash /tmp/tmp.sh "no "
bash /tmp/tmp.sh
bash /tmp/tmp.sh foo
#*

cat > /tmp/tmp.sh <<'---'
if [ "$1" == yes ]; then
  echo Yes!
elif [ "$1" == no ]; then
  echo No!
else
  echo Argh!
fi
---
bash /tmp/tmp.sh yes
bash /tmp/tmp.sh no
bash /tmp/tmp.sh "no "
bash /tmp/tmp.sh
bash /tmp/tmp.sh foo
#*




#####
#
# some "test"s (for a makefile)
# 2000oct12
#
#####

rm -Rv /tmp/test/
mkdir  /tmp/test/
cd     /tmp/test/
mkdir dir
echo -n > file
ln -s nowhere brokenlink
ln -s dir     dirlink
ln -s file    filelink



# (find-bashnode "Bash Conditional Expressions" "`test'")

#*
cat > $EEG <<'---'
cd
ls -lAFd a e s quux
test -a a       ;echo $?
test -a e       ;echo $?
test -a s       ;echo $?
test -a quux    ;echo $?
test ! -a quux  ;echo $?
test -a quux  -o  -a nuug  -o  -a faa ;echo $?
test -a quux  -o  -a a     -o  -a faa ;echo $?
exit
---
eeg bash
#*



#####
#
# case
# 2000nov15
#
#####

# «case»  (to ".case")
# (find-fline "/etc/init.d/")
# (find-fline "/etc/init.d/gpm" "case")
# (find-bashnode "Conditional Constructs" "dog | cat")
# (find-fline "~/bin/edrxpage")




#####
#
# arguments with spaces
# 2000nov26
#
#####

# «args_with_spaces»  (to ".args_with_spaces")
# (to "pdsc")
# This is not yet very satisfactory but will work for now.
#*
cat > $EEG <<'---'
perl -e 'print "$ARGV[0]::$ARGV[1]\n";' foo bar
perl -e 'print "$ARGV[0]::$ARGV[1]\n";' 'print "Hi!\n";' bar
perl -e 'print "$ARGV[0]::$ARGV[1]\n";''print "Hi!\n";' bar
function f1 () { perl -e 'print "$ARGV[0]::$ARGV[1]\n";' $*; }
function f2 () { perl -e 'print "$ARGV[0]::$ARGV[1]\n";'$*; }
f1 'print "Hi!\n";' bar
f2 'print "Hi!\n";' bar
f1 'print"Hi!\n";' bar
f2 'print"Hi!\n";' bar
exit
---
eeg bash
#*




#####
#
# adapting pdsc to bash
# 2000nov26
#
#####

# «pdsc»  (to ".pdsc")
# (to "args_with_spaces")
# (find-angg ".zshrc" "pdsc")
# (find-angg ".bashrc" "pdsc")
# (find-bashnode "Bourne Shell Builtins" "`shift'")

#*
cat > $EEG <<'---'
function perldsc () {
  perl -e '
    $_ = $dsc = $ARGV[0];
    (($path, $name, $ver, $build) =
        m%^(.*/)?(.*?)_(.*?)(-[0-9.a-z]+)?\.dsc$% )
            || die "\"$ARGV[0]\": not a dsc\n";
  '$*
}
perldsc 'print "/usr/src/$name-$ver\n"' /somedir/vrms_1.4.dsc
perldsc 'print"/usr/src/$name-$ver\n"'  /somedir/vrms_1.4.dsc

function dscdir () { perldsc 'print"/usr/src/$name-$ver\n"' $*; }
function pdsc () {
  D=$(dscdir $*) && {
    echo rm -Rv $D
    echo cd /usr/src/
    echo dpkg-source -sn -x $1
    echo cd $D
  }
}
pdsc /somedir/vrms_1.4.dsc
---
eeg bash
#*

# (find-angg ".bashrc" "pdsc")
cat > $EEG <<'---'
pdsc $SDEBIAN/dists/potato/main/source/admin/vrms_1.4.dsc
---
eeg bash
#*


  /snarf/ftp/ftp.debian.org/debian/dists/potato/main/source/admin/vrms_1.4.dsc


function dscdir () { perldsc 'print "/usr/src/$name-$ver\n"' $* }
function pdsc () {
  D=$(dscdir $*) && {
    rm -Rv $D
    cd /usr/src/
    dpkg-source -sn -x $1
    cd $D
  }
}
# Example:
# pdsc /debian/dists/slink/main/source/sound/workbone_2.40-1.dsc
# (find-fline "/usr/bin/dpkg-source")


#*
# (find-bashnode "Looping Constructs")
# (find-bashnode "Conditional Constructs")
# (find-bashnode "Bash Conditional Expressions")

i=1
while [[ $i -le 10 ]]; do
  echo $i
  i=$[$i+1]
done

#*



#####
#
# bashref
# 2001oct27
#
#####

# (find-sftpfile "ftp.gnu.org/pub/gnu/bash/")
# (find-sftpfile "ftp.gnu.org/pub/gnu/bash/bashref.texi.gz")

# (find-bashnode "Redirections" "format of here-documents")



#####
#
# exit codes and if
# 2004oct14
#
#####

# «exit-code-and-if»  (to ".exit-code-and-if")

function foo () { return $1 }
foo 99; echo $?
if foo 0; then echo y; else echo n; fi
if foo 1; then echo y; else echo n; fi

# function absolute () { readlink -f $1 }
function absolute () { case $1 in; /*) echo $1;; *) echo $PWD/$1;; esac }
absolute ~/foo
absolute foo




#####
#
# completion
# 2004oct04
#
#####

# (find-fline "/etc/")
# (find-fline "/etc/bash.bashrc")
# (find-fline "/etc/bash_completion")
# (find-fline "/etc/bash_completion.d/")
# (find-bashnode "Programmable Completion Builtins")







#####
#
# bash doesn't echo here-docs in "source" in verbose mode
# 2006sep11
#
#####

# «here-docs-verbose-mode»  (to ".here-docs-verbose-mode")
# «mailing-list»  (to ".mailing-list")
# http://lists.nongnu.org/mailman/listinfo/bug-bash
# http://lists.gnu.org/archive/html/bug-bash/2006-09/threads.html
# http://lists.gnu.org/archive/html/bug-bash/2006-09/msg00053.html

# (eekill "bug-bash@gnu.org")
# (eekill "Here-doc lines not echoed in \"source\" in verbose mode")

Hello list,

There's one situation in which I prefer zsh's behaviour over bash's...
Can anyone help me to make bash behave like zsh in this case? The fix
doesn't need to be a pure shell thing, there's no problem if I need
to patch the C source locally, I can keep a patched bash in ~/bin/, as
this is just for interactive use...

Here it is: when "verbose" mode is on (i.e., after "set -v") then
"source"ing (a.k.a. "."-ing) a script in zsh outputs all the script
lines and, as they are executed, also their output; doing the same in
bash outputs the script lines _minus the ones that belong to
here-documents_, plus their outputs. Here's an example:


  /home/edrx(zsh)$ # Prepare the temporary script
  /home/edrx(zsh)$ cat > /tmp/ee.sh <<'%%%'
  > cd /tmp/
  > rev <<'---'
  > foo
  > bar
  > ---
  > echo $[1+2]
  > %%%
  /home/edrx(zsh)$ 
  /home/edrx(zsh)$ # Make 'ee' run it in verbose mode
  /home/edrx(zsh)$ function ee () { set -v; . /tmp/ee.sh; set +v; }
  /home/edrx(zsh)$ 
  /home/edrx(zsh)$ # Run it - note how in zsh the here-doc lines
  /home/edrx(zsh)$ # ARE echoed
  /home/edrx(zsh)$ ee
  cd /tmp/
  rev <<'---'
  foo
  bar
  ---
  oof
  rab
  echo $[1+2]
  3
  /tmp(zsh)$


  /home/edrx(bash)$ # Prepare the temporary script
  /home/edrx(bash)$ cat > /tmp/ee.sh <<'%%%'
  > cd /tmp/
  > rev <<'---'
  > foo
  > bar
  > ---
  > echo $[1+2]
  > %%%
  /home/edrx(bash)$ 
  /home/edrx(bash)$ # Make 'ee' run it in verbose mode
  /home/edrx(bash)$ function ee () { set -v; . /tmp/ee.sh; set +v; }
  /home/edrx(bash)$ 
  /home/edrx(bash)$ # Run it - note how in bash the here-doc lines
  /home/edrx(bash)$ # are NOT echoed
  /home/edrx(bash)$ ee
  cd /tmp/
  rev <<'---'
  oof
  rab
  echo $[1+2]
  3
  /tmp(bash)$


Thanks in advance,
  Eduardo Ochs
  http://angg.twu.net/



P.S.: here are some links that explain why I need to source
temporary scripts in verbose mode...
  http://angg.twu.net/eev-article.html
  http://angg.twu.net/eev-current/eev.el.html#eev
  http://angg.twu.net/eev-current/README.html
  http://angg.twu.net/eev-current/doc/shot-f3.png






#####
#
# bash-3.1 (for its manual in info formal - it's non-DFSG and not in etch)
# 2007may14
#
#####

# «bash-3.1-info»  (to ".bash-3.1-info")
# (find-angg ".emacs" "bash")
# (find-es "dpkg" "install-info")
# (find-bashsrcfile "doc/bashref.info" "START-INFO-DIR-ENTRY")

# (find-status   "bash")
# (find-vldifile "bash.list")
# (find-udfile   "bash/")
# (find-status   "bash-doc")
# (find-vldifile "bash-doc.list")
# (find-udfile   "bash-doc/")

# (find-man "8 install-info")

# (find-node "(bashref)")
# (find-fline "~/info/bashref.info")

# (find-status   "bash")
# (find-vldifile "bash.list")
# (find-udfile   "bash/")
# (find-status   "bash-doc")
# (find-vldifile "bash-doc.list")
# (find-udfile   "bash-doc/")
# Strange, bash-doc in etch says that it includes the info docs, but
# it doesn't...

# http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz
#*
rm -Rfv ~/usrc/bash-3.1/
tar -C ~/usrc/ -xvzf \
  $S/http/ftp.gnu.org/gnu/bash/bash-3.1.tar.gz
cd     ~/usrc/bash-3.1/

#*
# Not really needed... what we want is bashref.info,
# that comes in the tarball.
# (find-bashsrcfile "")
# (find-bashsrcfile "omd")
# (find-bashsrcfile "doc/" "bashref.info")
# (find-bashsrcfile "doc/bashref.info")

cd ~/usrc/bash-3.1/
./configure |& tee oc
make doc    |& tee omd

#*
# «bash-3.2-info»  (to ".bash-3.2-info")
# http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz
#
rm -Rv ~/usrc/bash-3.2/
tar -C ~/usrc/ -xvzf \
  $S/http/ftp.gnu.org/gnu/bash/bash-3.2.tar.gz
cd     ~/usrc/bash-3.2/

#*
# (find-fline "~/info/")
# (find-fline "~/info/bashref.info")
# (find-zsh "cd ~/info/ && mydiff bashref.info")

# cd ~/usrc/bash-3.1/doc/
  cd ~/usrc/bash-3.2/doc/
cp -v bash*info ~/info/

cd ~/info/
patch -p0 bashref.info <<'%%%'
30c30
< * Bash: (bash).                     The GNU Bourne-Again SHell.
---
> * Bash: (bashref).                  The GNU Bourne-Again SHell.
%%%

# install-info --section Shells Shells --quiet /usr/share/info/zsh.info.gz
# sudo install-info --section Shells Shells ~/info/bashref.info
sudo ginstall-info \
  --section=Shells \
  --dir-file=/usr/share/info/dir \
  ~/info/bashref.info

#*
# (find-man "1 ginstall-info")
# (find-sh "locate -i info/dir")
# (find-fline "/usr/share/info/" "dir\n")
# (find-fline "/usr/share/info/dir")
# (find-sh "locate -i info/dir")
# (find-zsh "dmissing info/bash")

#*
# «bash-4.1-info»  (to ".bash-4.1-info")
# http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz
# (eev-bounded)
#
rm -Rfv ~/usrc/bash-4.1/
tar -C  ~/usrc/ -xvzf \
  $S/http/ftp.gnu.org/gnu/bash/bash-4.1.tar.gz
cd      ~/usrc/bash-4.1/

cd     ~/usrc/bash-4.1/doc/
cp -v bash*info ~/info/

# (find-fline "~/info/")
# (find-bashnode "")

#*
# (code-c-d "bashsrc" "~/usrc/bash-4.1/")
# (find-bashsrcfile "")
# (find-bashsrcfile "doc/")

#*
# (code-c-d "bashsrc" "~/usrc/bash-3.1/")
# (find-bashsrcfile "")
# (find-bashsrcfile "Makefile.in")
# (find-bashsrcfile "Makefile")
# (find-bashnode "")
# (find-bashnode "Bash Variables" "`TMOUT'")

# http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz
# http://ftp.gnu.org/gnu/bash/bash-4.0.tar.gz
# http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz

#*
# (code-c-d "bash" "~/usrc/bash-3.2/")
# (find-bashfile "")




#####
#
# bash-doc
# 2010sep11
#
#####

# «bash-doc»  (to ".bash-doc")
# (find-status   "bash-doc")
# (find-vldifile "bash-doc.list")
# (find-udfile   "bash-doc/")
# (find-bashfile "examples/bashdb/bashdb.el")

# (find-zsh "availabledebs | sort | grep bash")
# (find-bashnode "Bourne Shell Variables" "PS1")
# (find-bashnode "Bourne Shell Variables" "PS2")
# (find-bashnode "Interactive Shell Behavior" "PS1")
# (find-bashnode "Interactive Shell Behavior" "PS2")




#####
#
# Prompt (PS1)
# 2012oct27
#
#####

# «prompt»  (to ".prompt")
# (find-angg ".bashrc")
# (find-sh "uname --help")
# (find-sh0 "uname -n")
# (find-sh0 "uname -n | cut -b1-2")

* (eepitch-bash)
* (eepitch-kill)
* (eepitch-bash)
export PS1='\u@\h:\w\$ '
echo   PS1="\$PWD# "
export PS1="\$PWD# "
export PS1="\$PWD(\\u)# "
export PS1="\$PWD(\\u)\\\$ "
export PS1="\$PWD(\\u:$(uname -n))# "
export PS1="\$PWD(\\u:$(uname -n | cut -b1-2))# "
export PS1="\$PWD(\\u:$(uname -n | cut -b1-2))\$ "
export PS1="\$PWD(\\u:$(uname -n | cut -b1-2))\\\$ "
echo  $PS1

uname
uname -a
uname -n



#####
#
# Something corresponding to the TTY var in zsh
# 2012mar28
#
#####

# «tty-var»  (to ".tty-var")
# (find-es "zsh" "tty-var")
# (find-man "chvt")
# (find-status   "console-tools")
# (find-vldifile "console-tools.list")
# (find-udfile   "console-tools/")
# (find-status   "kbd")
# (find-vldifile "kbd.list")
# (find-udfile   "kbd/")




#####
#
# .bashrc (making it always be read)
# 2012mar28
#
#####

# «login-shell»  (to ".login-shell")
# (find-bashnode "Interactive Shell Behavior")
# (find-bashnode "Invoking Bash" "`--norc'")
# (find-bashnode "Invoking Bash" "`--login'")
# (find-bashnode "Invoking Bash" "A _login_ shell is one")
# (find-bashnode "Bash Startup Files" "`--login'")

# (find-eevfile "BUGS" "bash doesn't read ~/.bashrc")




#####
#
# process substitution
# 2013oct02
#
#####

# «process-substitution» (to ".process-substitution")
# http://mywiki.wooledge.org/ProcessSubstitution
# http://mywiki.wooledge.org/BashFAQ/024
# (find-bashnode "Process Substitution")
# (find-bashnode "Process Substitution" "<(LIST)")




#####
#
# shellshock
# 2014sep26
#
#####

# «shellshock» (to ".shellshock")
# http://safeandsavvy.f-secure.com/2014/09/26/shellshock-only-concerns-server-admins-wrong/
# http://www.ibtimes.co.uk/what-shellshock-os-x-linux-bash-bug-that-could-be-bigger-heartbleed-1467201
# https://www.digitalocean.com/community/tutorials/how-to-protect-your-server-against-the-shellshock-bash-vulnerability
# (find-status   "bash")
# (find-vldifile "bash.list")
# (find-udfile   "bash/")
# (find-udfile "bash/changelog.Debian.gz" "which contain shell functions.")

sudo apt-get update && sudo apt-get install --only-upgrade bash

* (eepitch-bash)
* (eepitch-kill)
* (eepitch-bash)
env x='() { :;}; echo vulnerable' bash -c 'echo hello'

vulnerable
hello

bash: warning: x: ignoring function definition attempt
bash: error importing function definition for 'x'
hello




#####
#
# Julio Neves
# 2015aug28
#
#####

# «julio-neves» (to ".julio-neves")
# http://wiki.softwarelivre.org/TWikiBar/WebHome
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo001
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo002
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo003
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo004
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo005
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo006
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo007
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo008
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo009
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo010
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarPapo011
# http://wiki.softwarelivre.org/TWikiBar/TWikiBarBirinaite







http://tldp.org/LDP/abs/html/


<zendeavor> !type
<greybot> type tells you how a command will be interpreted by the
          shell. Don't use 'which'; use 'type -P' instead, because
          it's portable and consistent.

http://mywiki.wooledge.org/BashPitfalls#pf25

# (find-node "(bashref)Invoking Bash" "`--norc'")
# (find-node "(bashref)Invoking Bash" "`--norc'" "invoked as `sh'")
# (find-man "bash")


  (find-man "1 bash" "--norc" "~/.bashrc" "invoked as sh")
  (find-man "1 bash" "\nINVOCATION\n" "interactive shell")
  (find-man "1 bash" "\nINVOCATION\n" "interactive shell" " ~/.bashrc")
  (find-man "1 bash" "\nFILES\n" "~/.bashrc" "individual per-interactive-shell")

# (find-man "1 bash" "\nINVOCATION\n")


# http://tldp.org/LDP/abs/html/index.html
# http://tldp.org/guides.html
# http://tldp.org/LDP/Bash-Beginners-Guide/Bash-Beginners-Guide.txt.gz
# http://tldp.org/LDP/abs/abs-guide.txt.gz





#  Local Variables:
#  coding:               no-conversion
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: