Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug in function in function



Hi,

I had the following definition in my zshrc:
   rpg()
   {
      if whence rpg-cli >&-
      then
	 if ! functions cd >&-
	 then
	    cd()
	    {
	       CLICOLOR_FORCE=1 rpg-cli cd "$@" | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
	       builtin cd "$(rpg-cli pwd)"
	    }
	    ls()
	    {
	       command ls "$@"
	       if [ $# -eq 0 ]
	       then
		  CLICOLOR_FORCE=1 rpg-cli cd -f . | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
		  CLICOLOR_FORCE=1 rpg-cli ls | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
	       fi
	    }
	 fi
	 CLICOLOR_FORCE=1 rpg-cli "$@" | sed -e 's/â\x96¡/o/g' -e 's/â\x9c\x94/ø/g' -e 's/\xf0\x9f\x92\x80/:-(/g' -e 's/\xf0\x9f\x93\xa6/\xa4/g' -e 's/\xf0\x9f\xaa\xa6/\xab/g' -e 's/\xe2\x9c\xa8/*/g' -e 's/\xf0\x9f\x94\xa5/\xbb\xab/g' -e 's/\xe2\x98\xa0\xef\xb8\x8f/\xa7/g'
	 builtin cd "$(rpg-cli pwd)"
      else
	 echo "No rpg-cli installed"
	 return 1
      fi
   }

This was working fine until recent.

Now I get an error in the `ls()` line. It is even more strange that I
don't get an error when compiling it as zwc file!

Is there any recent that has changed?

My zsh is Version 5.9.

Please keep me in Cc as I am not registered to the list...

Regards
   Klaus
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <Klaus@xxxxxxxxx>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C

Attachment: signature.asc
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author