Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on the Z shell.
#
# 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.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# 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/zsh.e>
#           or at <http://angg.twu.net/e/zsh.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/>.
#
#######





# «.zsh-debian»			(to "zsh-debian")
# «.ksh»			(to "ksh")
# «.zsh-beta»			(to "zsh-beta")
# «.zsh-hurd»			(to "zsh-hurd")
# «.zsh-files»			(to "zsh-files")
# «.zsh_help»			(to "zsh_help")
# «.heredoc»			(to "heredoc")
# «.zsh_suid»			(to "zsh_suid")
# «.bindkey_bug»		(to "bindkey_bug")
# «.strange_arguments»		(to "strange_arguments")
# «.prompt»			(to "prompt")
# «.NULL_GLOB»			(to "NULL_GLOB")
# «.zcatinfo»			(to "zcatinfo")
# «.unsetall»			(to "unsetall")
# «.compctl_defaults»		(to "compctl_defaults")
# «.completion-sudo»		(to "completion-sudo")
# «.alias-and-unalias»		(to "alias-and-unalias")
# «.aliases-in--c»		(to "aliases-in--c")
# «.arrays»			(to "arrays")
# «.foreachline»		(to "foreachline")
# «.zshrc-hash-bang-eval»	(to "zshrc-hash-bang-eval")
# «.oh-my-zsh»			(to "oh-my-zsh")
# «.tty-var»			(to "tty-var")
# «.dot-vs-source»		(to "dot-vs-source")
# «.wait»			(to "wait")
# «.expansion»			(to "expansion")
# «.irc-channel»		(to "irc-channel")
# «.backeted-paste»		(to "backeted-paste")
# «.positional-parameters»	(to "positional-parameters")
# «.ohmyzsh»			(to "ohmyzsh")
# «.whence»			(to "whence")
# «.which»			(to "which")
# «.case»			(to "case")
# «.ORIGPATH»			(to "ORIGPATH")
# «.interactivecomments»	(to "interactivecomments")




https://en.wikipedia.org/wiki/Z_shell
http://zsh.sourceforge.net/
http://zsh.sourceforge.net/Doc/
http://zsh.sourceforge.net/Doc/Release/zsh_toc.html
http://zsh.sourceforge.net/Doc/Release/Invocation.html#Compatibility
  ^ it's hard to make something like this work:
      (find-zshnode "Compatibility")
      (info "(zsh)Compatibility")


http://zsh.sourceforge.net/Doc/Release/Invocation.html#Compatibility


#####
#
# Zsh on Debian
# 2011nov19
#
#####

# «zsh-debian»  (to ".zsh-debian")
# (find-angg ".emacs" "zsh")
# (find-status   "zsh")
# (find-vldifile "zsh.list")
# (find-udfile   "zsh/")
# (find-status   "zsh-doc")
# (find-vldifile "zsh-doc.list")
# (find-udfile   "zsh-doc/")
# (find-zshnode "")



#####
#
# Ksh
#
#####

# «ksh»  (to ".ksh")
# (find-zshnode "Compatibility")





#####
#
# Compiling zsh in the Hurd
#
#####

psnedeb <<'---'
   143332 dists/potato/main/source/shells/zsh30_3.0.7-4.diff.gz
      682 dists/potato/main/source/shells/zsh30_3.0.7-4.dsc
   650042 dists/potato/main/source/shells/zsh30_3.0.7.orig.tar.gz
---

pdsc $SDEBIAN/dists/potato/main/source/shells/zsh30_3.0.7-4.dsc
rm -Rv /gnu/usr/src/zsh30-3.0.7
cp -diPpvR /usr/src/zsh30-3.0.7 /gnu/

# Oops, seems that this zsh hasn't been ported to the Hurd yet!

# Trying again with a newer version.



#####
#
# zsh-beta (woody)
# 2000oct18
#
#####

# «zsh-beta»  (to ".zsh-beta")
#*
pdsc $SDEBIAN/dists/woody/main/source/shells/zsh-beta_3.1.9.dev6.0sf20001010-1.dsc
cd /usr/src/
tar -cvzf zshbetasrc.tgz zsh-beta-3.1.9.dev6.0sf20001010/
cd /usr/src/zsh-beta-3.1.9.dev6.0sf20001010/
debian/rules binary	|& tee odrb
#*

dpkg -i /usr/src/zsh-beta*.deb

# (find-status "zsh-beta")
# (find-vldifile "zsh-beta.list")
# (find-fline "/usr/doc/zsh-beta/")

# (find-status "zsh-beta-doc")
# (find-vldifile "zsh-beta-doc.list")
# (find-fline "/usr/doc/zsh-beta-doc/")



# «zsh-hurd»  (to ".zsh-hurd")
# (code-c-d "zshbeta" "/usr/src/zsh-beta-3.1.9.dev6.0sf20001010/")
# (find-zshbetafile "")
# (find-zshbetafile "odrb")
# (find-zshbetafile "debian/control" "Build-Depends"
# (find-zshbetafile "ChangeLog-Release" "hurd")
#*
cd /usr/src
mount -o remount,rw /gnu
cp /usr/src/zshbetasrc.tgz /gnu/usr/src/

#*





#####
#
# zsh startup/shutdown files
# 2000jun22
#
#####

# «zsh-files»  (to ".zsh-files")
# (find-node "(zsh)Files")

# (find-fline "/etc/zshenv")
# (find-fline "/etc/zprofile")
# (find-fline "/etc/zshrc")
# (find-fline "/etc/zlogin")
# (find-fline "/etc/zlogout")

# (find-fline "/etc/zsh30/zshenv")
# (find-fline "/etc/zsh30/zprofile")
# (find-fline "/etc/zsh30/zshrc")
# (find-fline "/etc/zsh30/zlogout")





#####
#
# zsh 3.1.4
# (old notes)
#
#####

cd /usr/src/
rm -Rv zsh-3.1.4/
tar -xvzf /snarf/ftp/ftp.zsh.org/pub/zsh-3.1.4.tar.gz
cd /usr/src/zsh-3.1.4/
./configure |& tee oc
make |& tee om
make prefix=/usr install |& tee omi

cd /usr/src/zsh-3.1.4/
etags $(find * -name '*.[ch]')

cp -v /usr/src/zsh-3.1.4/Doc/zsh.info* /usr/info/
rm -v /usr/info/zsh*gz

cd /bin/
[ -f zsh-3.0.2 ] || mv -iv zsh zsh-3.0.2
ln /usr/bin/zsh .

cd /snarf/http/www.ifh.de/~pws/computing/zsh_fns/
agrep zle *


# (find-zshnode "Top")
# (find-zshnode "Command Substitution")
# (find-zshnode "Editor Functions Index")
# (find-zshnode "Shell Builtin Commands")
# (find-zshnode "Completion")
# (find-zshnode "Zsh Line Editor" "User-Defined Widgets\n")
# (find-zshnode "Concept Index" "* widgets")
# (find-zshnode "The zle Module" "`zle' `-N'")

# (find-fline "/usr/src/zsh-3.1.4/Makefile")
# (find-zshfile "Src/Modules/example.c")
# (find-zshfile "Src/Modules/example.mdd")
# (find-zshfile "Src/Zle/iwidgets.list")
# (find-zshfile "Functions/zed")

# (find-zshfile "Src/builtin.c")
# (find-zshtag "bin_print")

function fooo() {
  echo a
  print -z 'Rum'
}

zle -N foo fooo
bindkey "^[[[E" foo


# (find-fline "/snarf/http/sunsite.auc.dk/zsh/FAQ/zshfaq.yo")
# (find-fline "/snarf/http/sunsite.auc.dk/zsh/FAQ/zshfaq.yo" "label(44)")

# Some examples:

i=0
while [ $i -le 100000 ]
do
   echo ':'$i':'
   i=$[$i+1024]
done




######
#
# zsh help
# 1999sep??
#
######

# «zsh_help»  (to ".zsh_help")
# (find-fline "/usr/doc/zsh/")
# (find-fline "/usr/doc/zsh/FEATURES")
# (find-fline "/usr/doc/zsh/examples/Util/")
# (find-fline "/usr/doc/zsh/examples/Util/helpfiles" "<Esc>-h")
# (find-angg ".zshrc" "run-help")

# Only the "builtins" are covered, the ones in:
# (find-zshnode "Shell Builtin Commands")

cd ~
rm -Rv $ZSHHELPDIR
mkdir $ZSHHELPDIR &&
cd $ZSHHELPDIR && {
  man zshbuiltins | colcrt - | perl /usr/doc/zsh/examples/Util/helpfiles
}





#####
#
# zsh ref card
#
#####

xdvi -paper 30x21cm $S/http/www.ifh.de/~pws/computing/refcard.dvi &

cd /tmp/
cp -v $S/http/www.ifh.de/~pws/computing/refcard.dvi .
make -f ~/LATEX/Makefile refcard.ps refcard.zip




#####
#
# heredoc
#
#####

# «heredoc»  (to ".heredoc")

# (find-node "(zsh)Shell Builtin Commands" "`getopts")
# (find-zshfile "Src/builtin.c" "to start a new option parse")
# (find-fline "/usr/doc/zsh/examples/Functions/zls" "getopts")
# (find-fline "~/.zshrc" "heredoc")

heredoc /tmp/bar  -o edrx:edrx -m 0333 <<'---'
foo bar
---
laf /tmp

# This works but interacts badly with set +v/set -v:
cat <<---
echo $SHELL
---





#####
#
# Running as other users
#
#####

# «zsh_suid»  (to ".zsh_suid")
# (find-node "(zsh)Parameters Set By The Shell" "EUID")
# (find-node "(zsh)Parameters Set By The Shell" "USERNAME")
# (find-node "(sh-utils)User information")
# (find-fline "/etc/passwd")
# (find-fline "/etc/groups")
cat /etc/passwd /etc/groups | sort

# (find-k2tag "sys_setgroups")
#*
id
id -g
id -G
id -u
id -ng
id -nu
id -nG
id -rg
id -ru
id -rG
id -nrg
id -nru
id -nrG
#*
(UID=$(id -u edrx); id)
(EUID=$(id -u edrx); id)
(UID=$(id -u edrx); EUID=$UID; id)
(UID=$(id -u edrx); EUID=$UID; GID=$UID; id)
(UID=$(id -u edrx); GID=$UID; EUID=$UID; id)
(GID=$(id -u edrx); EUID=$GID; UID=$GID; id)
(GID=$(id -u edrx); UID=$GID; EUID=$GID; id)
#*
USERNAME=edrx id
(USERNAME=edrx; id; echo $HOME)
#*



#####
#
# Recompiling zsh at twu
# 99dec05
#
#####

# (find-fline "$SDEBIAN/ls-lR.i")

mkdir ~/dl
cd ~/dl
export FDEBIAN_UTK=ftp://ftp.sunsite.utk.edu/pub/linux/Debian
export FDEBIAN=$FDEBIAN_UTK
echo $FDEBIAN

wget $FDEBIAN/dists/slink/main/source/shells/zsh_3.1.2-10.diff.gz
wget $FDEBIAN/dists/slink/main/source/shells/zsh_3.1.2-10.dsc
wget $FDEBIAN/dists/slink/main/source/shells/zsh_3.1.2.orig.tar.gz

cd ~/dl/
'rm' -R zsh-3.1.2 zsh-3.1.2.orig

cd ~/dl
tar -xvzf zsh_3.1.2.orig.tar.gz
ln -s zsh-3.1.2 zsh-3.1.2.orig
zcat zsh_3.1.2-10.diff.gz | patch -p0	2>&1 | tee op

cd ~/dl/zsh-3.1.2/
./configure	2>&1 | tee ../oc
cd ~/dl/zsh-3.1.2/Src/
make		2>&1 | tee ../om
cd ~/dl/zsh-3.1.2/Src/
cp -v zsh ~/bin/




# ifdef LOCAL
#
mkdir ~/dl
cd /big/slinks2/dists/slink/main/source/shells/
cp -v zsh* ~/dl
#
# endif


# Lixos:

# (find-node "(bash)Redirections")
# (find-node "(bash)Pipelines")

cp -v /big/slinkb1/dists/slink/main/binary-i386/shells/zsh_3.1.2-10.deb ~/dl/
cd ~/dl/
# ar p zsh_3.1.2-10.deb data.tar.gz | tar -tvzf -
ar p zsh_3.1.2-10.deb data.tar.gz | tar -xvzf - usr/bin/zsh
mv -v usr/bin/zsh ~/bin/

cd ~/dl/
wget $FDEBIAN/dists/slink/main/binary-i386/shells/zsh_3.1.2-10.deb
ar p zsh_3.1.2-10.deb data.tar.gz | tar -xvzf - usr/bin/zsh
mv -v usr/bin/zsh ~/bin/





#####
#
# bindkey bug in zsh-3.1.6
# 2000mar28
#
#####

# «bindkey_bug»  (to ".bindkey_bug")
# (find-fline "/etc/passwd")
# (find-fline "~/EXPECT/bindkey_bug")

ln -sf ~root/EXPECT/bindkey_bug ~a/bkb




#####
#
# How to pass arguments with strange chars
# 2000may18
#
#####

# «strange_arguments»  (to ".strange_arguments")
# (find-zshfile "Src/exec.c" "here document ")

cat > ~/o <<'---'
foo
  bar		wiki

  am
---
echo "$(<~/o)"




#####
#
# prompt
# 2000jun21
#
#####

# «prompt»  (to ".prompt")
# (find-angg ".zshrc" "prompt")
# (find-zshnode "Parameters Used By The Shell" "PS1")
# (find-zshnode "Parameters Used By The Shell" "`PS1'" "`%n'")
# (find-zshnode "Parameters Set By The Shell" "`USERNAME'")
# (find-zshnode "Prompt Expansion")

# First char of the name of the machine:
uname -n
export machine=$(uname -n)
echo $machine[1]

export PS1="%d(%n:$machine[1])# "
echo $PS1

# (find-angg ".zshrc" "prompt")
if [[ $machine = angg ]]; then
  export PS1='%d(%n)# '
else
  export PS1="%d(%n:$machine[1])# "
fi

# But %n is the username, not the effective username...
# (find-angg ".zshrc.local.mcgill" "prompt")




#####
#
# NULL_GLOB
# 2021oct10
#
#####

# «NULL_GLOB»  (to ".NULL_GLOB")
# (find-node "(zsh)Filename Generation")
# (find-node "(zsh)Description of Options" "\nNULL_GLOB")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

# (find-fline "/usr/share/info/")
cd /usr/share/info/
ls gdb*
ls find*
(setopt   NULL_GLOB; echo  gdb.info{,-?,-??}.gz)
(setopt   NULL_GLOB; echo find.info{,-?,-??}.gz)
(setopt   NULL_GLOB; echo  gdb{,.info}{,-?,-??}.gz)
(setopt   NULL_GLOB; echo find{,.info}{,-?,-??}.gz)
(unsetopt NULL_GLOB; echo  gdb.info{,-?,-??}.gz)
(unsetopt NULL_GLOB; echo find.info{,-?,-??}.gz)




#####
#
# More about globbing
# 2000aug27
#
#####

# «zcatinfo»  (to ".zcatinfo")
# (find-angg ".zshrc" "zcatinfo")
#*
cd /usr/share/info/
ls gdb*
ls ipc*
(setopt NULL_GLOB; zcat gdb.info{,-?,-??}.gz)    |& l
(setopt NULL_GLOB; zcat ipc.info{,-?,-??}.gz)    |& l
(setopt NULL_GLOB; zcat gdb{,.info}{,-?,-??}.gz) |& l
(setopt NULL_GLOB; zcat ipc{,.info}{,-?,-??}.gz) |& l
(unsetopt NULL_GLOB; zcat gdb.info{,-?,-??}.gz)  |& l
(unsetopt NULL_GLOB; zcat ipc.info{,-?,-??}.gz)  |& l
#*

# Note that zcatinfo as it is now will complain about not finding
# xxx.info.gz or xxx.gz -- and we always have at most one of them, so
# we always get a (harmless) error.

#*
# (find-man "find")
# (find-man "find" "-maxdepth levels")
# (find-man "find" "-regex pattern")
cd /usr/share/info/
ls gdb*
ls ipc*
(setopt NULL_GLOB; zcat gdb.info{,-?,-??}.gz) |& l

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

#*




#####
#
# unsetall
# 2000oct09
#
#####

# «unsetall»  (to ".unsetall")
# (find-angg ".zshrc" "unsetall")

# The test below needs to be run inside eeg because "unsetall" lives
# in my .zshrc... an apparent alternative would be to run it directly
# but within "()"s, but then we would get output only after the full
# "()" block, not after each line, and the output would be very
# difficult to interpret by lazy minds like mine.

#*
cat > $EEG <<'---'
set | wc
unsetall set | wc
set | wc
_unsetall
set | wc
env
exit
---
# Now entering another zsh, with eeg; you should type a series of "M-l"s.
eeg zsh
# Done.

#*
set | grep -a -v '='
set | awk -F '=' 'NF>1 {print $1}'

#*
set | awk -F '=' 'NF>1 {print $1}' | grep    '^[A-Z]'
set | awk -F '=' 'NF>1 {print $1}' | grep -v '^[A-Z]'

#*
# (find-node "(zsh)Process Substitution" "If =(...) is used")
comm -2 -3 \
  =(set | awk -F '=' 'NF>1 {print $1}' | grep '^[A-Z]') \
  =(print -l ZSH_NAME ZSH_VERSION)

#*




#####
#
# compctl defaults
# 2000oct09
#
#####

# «compctl_defaults»  (to ".compctl_defaults")
# (find-angg ".zshrc" "completion")
# "beth" is one of the accounts I use for tests; her home dir doesn't
# have any zsh initialization files.
# (find-es "mail" "test-pop3server")
#*
cat > $EEG <<'---'
echo
zsh30
  echo $ZSH_VERSION
  compctl
  compctl -L
  exit
echo
zsh
  echo $ZSH_VERSION
  compctl
  compctl -L
  exit
exit
---
eeg su - beth
#*





#####
#
# the default completion method for sudo
# 2004sep07
#
#####

# «completion-sudo»  (to ".completion-sudo")
# (find-status   "zsh")
# (find-vldifile "zsh.list")
# (find-udfile   "zsh/")
#*
cd /var/lib/dpkg/info/
grep -l sudo $(<zsh.list)
#*
# (find-fline "/etc/zsh/zshrc")
# (find-fline "/usr/share/zsh/4.2.0/functions/Completion/Unix/_sudo")
# (find-zshnode "The zsh/zutil Module")




#####
#
# alias-and-unalias
# 2020sep14
#
#####

# «alias-and-unalias»  (to ".alias-and-unalias")
# (find-node "(zsh)Shell Builtin Commands" "alias")
# (find-node "(zsh)Shell Builtin Commands" "unalias")




#####
#
# using aliases in a "-c" block
# 2004sep27
#
#####

# «aliases-in--c»  (to ".aliases-in--c")
# (find-node "(zsh)Invocation")
# (find-node "(zsh)Expansion")
# (find-node "(zsh)Shell Builtin Commands" "enable [ -afmrs ] NAME ...")

#*
echo "alias w=which" > /tmp/.zshrc
zsh -c ". /tmp/.zshrc; alias w"
zsh -c ". /tmp/.zshrc;   /usr/bin/w w"
zsh -c ". /tmp/.zshrc;        which w"
zsh -c ". /tmp/.zshrc;            w w"
zsh -c ". /tmp/.zshrc; enable -a; w w"
zsh -c ". /tmp/.zshrc; enable -af > /dev/null; w w"
zsh -c ". /tmp/.zshrc; function w () { which $* }; w w"

#*
# how do I enable aliases in a "-c" block?
# (...)
# I can't make "w w" behave as "which w"

# Here's what I'm trying to do...

# (find-efunction 'shell-command-to-string)

(defun zsh-command-to-string (command)
  (with-output-to-string
    (with-current-buffer
      standard-output
      (call-process "/usr/bin/zsh" nil t nil
		    "-c" command))))

(defun zsh-do (command)
  (zsh-command-to-string (concat "TERM=nil . ~/.zshrc\n" command)))

(zsh-command-to-string "TERM=nil . ~/.zshrc; enable -a > /dev/null\nw")
(zsh-command-to-string "TERM=nil . ~/.zshrc\nw zsh")
(zsh-command-to-string "TERM=nil . ~/.zshrc\n/usr/bin/w")

(zsh-do "w")
(zsh-do "/usr/bin/w")
(zsh-do "alias w")
(zsh-do "w")
# (find-node "(zsh)Aliasing")





#####
#
# arrays
# 2019sep22
#
#####

# «arrays» (to ".arrays")
# (find-zshnode "Prompt Expansion" "if the array psvar has at least N elements")
# (find-zshnode "Parameter Expansion" "array=")
# (find-zshnode "Parameter Expansion")
# (find-zshnode "Parameter Expansion" "${#SPEC}")
# (find-zshnode "Shell Builtin Commands" "\nprint")
# (find-zshnode "Array Parameters")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
A=(foo bar plic ploc)
A=("first word" "second word")
echo $A
print -l foo bar
print -l $A
echo ${#A}

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
A=(one [3]=three four)
echo $A
echo $A[1]
echo $A[2]
echo $A[3]
echo $A[4]

A=(aa bb cc)
B=(dd ee $A ff gg)
echo $B





#####
#
# iterating over lines of a file
# 2004oct02
#
#####

# «foreachline»  (to ".foreachline")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-node "(zsh)Parameter Expansion" "If NAME is an array parameter")
A=(foo bar plic ploc)
print -l $A


# (find-node "(zsh)Parameter Expansion" "For example, ${(f)")
cat > /tmp/o <<'%%%'
  aaa a
b   bbb b

ccc ccc
%%%
for i in  $(   </tmp/o)      ; do echo _${i}_; done
for i in "$(   </tmp/o)"     ; do echo _${i}_; done
for i in  ${(f)"$(</tmp/o)"} ; do echo _${i}_; done
for i in  ${(z)"$(</tmp/o)"} ; do echo _${i}_; done
for i in  ${(f)$(</tmp/o)}   ; do echo _${i}_; done
for i in  ${(z)$(</tmp/o)}   ; do echo _${i}_; done

#*




#####
#
# running .zshrc-dependent scripts
# 2007dec21
#
#####

# «zshrc-hash-bang-eval»  (to ".zshrc-hash-bang-eval")
# (find-angg ".zshrc")
# The trick: a
#   #!/usr/bin/env zsh
# at the top of the .zshrc file, and an
#   eval $1
# at the bottom - then things like
#   ~edrx/.zshrc installeddebs
# should work -

# Oops - should I set $SHELL, $HOME, etc, like run-zsh?
# (find-angg "run-zsh")




#####
#
# Oh my zsh
# 2011nov07
#
#####

# «oh-my-zsh»  (to ".oh-my-zsh")
# https://github.com/robbyrussell/oh-my-zsh
# http://news.ycombinator.com/item?id=1668628
#   http://zsh.sourceforge.net/Guide/
# http://gregs.tcias.co.uk/2011/05/20/oh-my-zsh/

# http://ohmyz.sh/
# https://github.com/robbyrussell/oh-my-zsh




#####
#
# The TTY var
# 2012mar28
#
#####

# «tty-var»  (to ".tty-var")
# (find-angg ".zshrc" "ae")
# (find-node "(zsh)Prompt Expansion" "%l")
# (find-node "(zsh)Prompt Expansion" "%y")
# (find-node "(zsh)Parameters Set By The Shell" "TTY")
# (find-es "bash" "tty-var")




#####
#
# . vs source
# 2014aug05
#
#####

# «dot-vs-source» (to ".dot-vs-source")
# https://unix.stackexchange.com/questions/17815/running-script-with-and-with-source



#####
#
# wait
# 2014dec01
#
#####

# «wait» (to ".wait")
# (find-man "1 zshbuiltins")
# (find-man "1 zshbuiltins" "wait")



#####
#
# Expansion
# 2018jun02
#
#####

# «expansion» (to ".expansion")
# (find-zshnode "Parameter Expansion")
# (find-zshnode "Parameter Expansion" "${i:s/foo/bar/}")
# (find-zshnode "Parameter Expansion" "${~SPEC}")
# (find-zshnode "Parameter Expansion" "14.3.1 Parameter Expansion Flags")
# (find-zshnode "Parameter Expansion" "14.3.1 Parameter Expansion Flags" "\ne")
# (find-zshnode "Modifiers")

# (find-fline "~/LOGS/2018jun02.zsh")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
P="~/eev-current/"
echo $P
echo ${P}
echo ${(e)P}
echo ${~P}




#####
#
# IRC channel
# 2018jun02
#
#####

# «irc-channel» (to ".irc-channel")

(defun z2 () (interactive) (find-rcirc-buffer-2a "irc.freenode.net" "#zsh" nil "#zsh"))
(defun z3 () (interactive) (find-rcirc-buffer-3a "irc.freenode.net" "#zsh" nil "#zsh"))





#####
#
# terminfo
# 2004nov28
#
#####

# (find-fline "/etc/zsh/zshrc")
# (find-man "3ncurses terminfo")
# (find-man "5 terminfo" "khome")

# (find-man "5 terminfo" "tee pointing down")
# (find-man "5 terminfo" "ACS_DARROW")

# (find-man "1 tic" "$HOME/.terminfo")
# (find-man "1 infocmp")
# (find-sh "infocmp linux")
# (find-sh "infocmp screen")
# (find-sh "infocmp screen.linux")
# (find-sh "infocmp -1 xterm")

# (find-status   "dialog")
# (find-vldifile "dialog.list")
# (find-udfile   "dialog/")
# (find-udfile   "dialog/examples/")

#*
rm -Rv   /tmp/terminfo
mkdir    /tmp/terminfo
cat > /tmp/linuxmine <<'%%%'
#	Reconstructed via infocmp from file: /etc/terminfo/l/linux
#	acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, 
# (find-sh "infocmp linux")
#
linuxmine|linux console mine, 
	am, bce, ccc, eo, mir, msgr, xenl, xon, 
	colors#8, it#8, ncv#18, pairs#64, 
       acsc=+>\,<-^.v0#`+a:f\\g#h#i#j+k+l+m+n+o~p-q-r-s_t+u+v+w+x|y<z>{*|!}f~o,
	bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l\E[?1c, 
	clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, 
	csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, 
	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?8c, 
	dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, 
	dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, 
	flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, 
	ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, 
	il1=\E[L, ind=^J, 
	initc=\E]P%p1%x%p2%{256}%*%{1000}%/%02x%p3%{256}%*%{1000}%/%02x%p4%{256}%*%{1000}%/%02x, 
	invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, 
	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, 
	kend=\E[4~, kf1=\E[[A, kf10=\E[21~, kf11=\E[23~, 
	kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, 
	kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, 
	kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, 
	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 
	khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
	kspd=^Z, nel=^M^J, oc=\E]R, op=\E[39;49m, rc=\E8, rev=\E[7m, 
	ri=\EM, rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, 
	rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, 
	setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 
	sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 
	sgr0=\E[0;10m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, 
	smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, 
	u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, 
%%%
TERMINFO=/tmp/terminfo tic /tmp/linuxmine
# (find-sh "TERMINFO=/tmp/terminfo infocmp linuxmine")
cd /usr/share/doc/dialog/examples/
TERMINFO=/tmp/terminfo TERM=linuxmine ./menubox

#*
# ok but this messed up with the background colors.
# Discover how to make a terminfo entry inherit from another one.


#*
# (find-node "(zsh)Shell Builtin Commands" "eval [ ARG ... ]")
function foo () { printf "%-10s ;#-> %s\n" $1 "$(eval $1)" }
set +v
foo 'id'
foo 'id -g'
foo 'id -G'
foo 'id -u'
foo 'id -ng'
foo 'id -nu'
foo 'id -nG'
foo 'id -rg'
foo 'id -ru'
foo 'id -rG'
foo 'id -nrg'
foo 'id -nru'
foo 'id -nrG'

#*





#####
#
# Turning off bracketed paste mode in zsh in a shell buffer
# 2018dec08
#
#####

# «backeted-paste» (to ".backeted-paste")
# (find-angg ".zshrc" "bracketed-paste")
# (find-es "console" "ansi.lua")
# (find-epackage-links 'bracketed-paste "bracketedpaste" t)
# https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_sequences
# https://emacs.stackexchange.com/questions/28851/how-to-turn-off-bracketed-paste-mode
# (find-node "(zsh)Parameters Used By The Shell" "zle_bracketed_paste")
#
# CSI ? 2004 h: Turn on bracketed paste mode. Text pasted into the
#               terminal will be surrounded by ESC [200~ and ESC [201~,
#               and characters in it should not be treated as commands
#               (for example in Vim).[16] From Unix terminal emulators.
# 
# CSI ? 2004 l: Turn off bracketed paste mode.

hi all... I am trying to debug something that is probably half emacs's
fault (read: my .emacs's fault) and half zsh's (read: my .zshrc's)...
when I run zsh in a shell buffer I always get an ESC [?2004h after
each prompt, even though my PS1 is quite minimal - just "%d(%n:rc)#
"...

anyone knows what this ESC [?2004h may be? I checked the manpage for
(4)console_codes and ESC [ is a "CSI" and the "h" seems to be "set
mode", but I'm having difficulty in interpreting the "?2004"...

btw, https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_sequences says
that "CSI ? 2004 h" is "turn on bracketed text mode" -

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
date
unset zle_bracketed_paste
date

->

/home/edrx(edrx:rc)# (ESC) [?2004h
date (ESC) [?2004l
Thu 16 Aug 16:04:41 -03 2018
/home/edrx(edrx:rc)# (ESC) [?2004hunset zle_bracketed_paste
unset zle_bracketed_paste (ESC) [?2004l
/home/edrx(edrx:rc)# date
Thu 16 Aug 16:04:45 -03 2018
/home/edrx(edrx:rc)# 

if [[ "$TERM" = dumb ]]; then unset zle_bracketed_paste; fi


# More on bracketed paste:
https://github.com/hanslub42/rlwrap/issues/108
https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-03/msg00206.html





#####
#
# positional parameters (like $1 and $*[2,-1])
# 2018dec26
#
#####

# «positional-parameters» (to ".positional-parameters")
# (find-zshnode "Positional Parameters" "command-line arguments")
# (find-zshnode "Positional Parameters" "$0")
# (find-zshnode "Positional Parameters" "$argv[N]")
# (find-zshnode "Array Parameters" "[EXP1,EXP2]")
# (find-angg ".zshrc" ".debs")
# (find-angg ".zshrc" ".debs" "$*[2,-1]")
# (find-angg ".zshrc" "flsfiles")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
foo () { echo $1 $*[3,-1] }
foo a b c d
foo




#####
#
# Oh my Zsh
# 2020may24
#
#####

# «ohmyzsh» (to ".ohmyzsh")
# https://www.facebook.com/WeAreOhMyZsh/
# https://github.com/ohmyzsh/ohmyzsh
# https://github.com/ohmyzsh/ohmyzsh/issues/7175
# https://www.freecodecamp.org/news/d-oh-my-zsh-af99ca54212c/



#####
#
# whence and which
# 2021aug19 / 2024oct15
#
#####

# «whence»  (to ".whence")
# «which»   (to ".which")
# (find-fline "~/.zshrc" "alias w='which'")
# (find-es "bash" "set")
# (find-es "bash" "which")
# (find-es "unix" "which")
# (find-node "(zsh)Functions Index" "* which")
# (find-node "(zsh)Shell Builtin Commands" "whence [ -vcwfpamsS ]")
# (find-node "(zsh)Shell Builtin Commands" "typeset -f")

https://news.ycombinator.com/item?id=29026623 Debian's Which Hunt (lwn.net)

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
typeset -fp screenkey-on
alias laf

w screenkey-on
w laf



#####
#
# case
# 2023oct07
#
#####

# «case»  (to ".case")
# (find-es "bash" "case")



#####
#
# ORIGPATH
# 2024may25
#
#####

# «ORIGPATH»  (to ".ORIGPATH")
# (find-fline "~/LOGS/2024may25.zsh")
# (find-es "unix" "env")
# (find-angg ".zshrc" "path")
# (find-angg ".zshrc" "texlive-2020")
# (find-angggrep "grep --color=auto -nH --null -e PATH .zshrc")
# (find-zsh "echo $PATH")
# (find-zsh "echo $PATH | tr : '\n'")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
[[ "$ORIGPATH" == "" ]] && echo "Empty origpath"
set | wc
env -i zsh -f
set | wc
set
[[ "$ORIGPATH" == "" ]] && echo "Empty origpath"
echo $PATH
echo $PATH | tr : '\n'

# (find-man "zsh")




#####
#
# interactivecomments
# 2024jul28
#
#####

# «interactivecomments»  (to ".interactivecomments")
# (find-fline "~/LOGS/2024jul28.zsh")
# (find-node "(zsh)Comments" "INTERACTIVE_COMMENTS")
# (find-node "(zsh)Options Index" "* INTERACTIVECOMMENTS:")
# (find-node "(zsh)Options Index" "* INTERACTIVE_COMMENTS:")






https://dataswamp.org/~incal/conf/.zsh/
https://dataswamp.org/~incal/conf/.zsh/url

http://magazine.redhat.com/2007/10/11/zero-to-z-shell-learn-what-all-the-fuss-is-about-with-z-shell/

https://news.ycombinator.com/item?id=28927966 s/bash/zsh/g (arp242.net)

https://news.ycombinator.com/item?id=33678107 Sweet Shell: With Oh-My-Zsh, SpaceVim, Starship, True Color, and Demo Mode (bretfisher.com)
https://jvns.ca/blog/2024/09/12/reasons-i--still--love-fish/





#  Local Variables:
#  coding:               utf-8-unix
#  End: