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

Re: Vanishing files ?



From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
Subject: Re: Vanishing files ?
Date: Sun, 28 May 2006 11:32:00 -0700

> On May 28,  5:24pm, Meino Christian Cramer wrote:
> }
> }  Why can I execute the contents of the script "tempwatch" but not the
> }  script itsself?
> 
> That usually means that the program named in the #! line is not where
> the path in that line says it is.
> 
> Have you checked that you're not, for example, attempting to execute
> a program named "/bin/zsh^M" (where ^M is a carriage return)?  Or some
> other stray character you can't see at the end of the line?  I assume
> zsh really is in /bin/.

  I did:
  solfire:/home/mccramer>ls -l /bin/zsh
  -rwxr-xr-x 2 root root 754456 Mar 28 18:32 /bin/zsh
  solfire:/home/mccramer>

  and it is no problem for me to execute /bin/zsh from the commandline
  -- just getting another shell.

  With vim I loaded the script in question and did a 
  "set list", which displays anything, which normally is suppressed.
  After the "h" of "#!/bin/zsh" there is only a "$", meaning that
  this is the end of line.

  Same results with another editor (Microemacs).

  Are there any other "bad invisible things", which may cause this
  effect ?

  Kepp hacking!
  Meino





> }  By the way: Does anyone know a trick how to remove _all_
> }  Escape-Sequences from a script generated by the command "script" ...
> 
> 	sed "s/[^"$'\t '"-~]//g"
> 
> The order of tab and space in $'\t ' is important.  The above actually
> strips anything that's not printable ASCII, so if you're using an ISO
> character set you probably need to put more stuff inside the [ ].
> 



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