SPUG: No such file?
andy at n2h2.com
Fri Jan 28 21:43:11 CST 2000
On Jan 28, 2000 @ 5:48pm, William Julien wrote:
> >What is going on here?
> >bash-2.03$ app.pl
> >bash: ./app.pl: No such file or directory
> Let me guess. Was the program was written on a winbox and uploaded to a unix
> server in binary mode? So, the unix shell sees the dos line end character
> on the header. In a "real man's editor"... like uh, ... vi!; you would see:
> "/usr/bin/perl^M". Guess what... there is "No such file or directory"
> by that name!
Wow! My mystery is solved. Every once in a while this would happen to me.
About as often as I'm forced to edit a script on a system with MS-DOS in
its family tree. I never made the connection and hadn't thought to examine
the file contents itself. I usually just nuked it and started over. And
all I needed was a quick,
tr -d "\r" < f1 > f2
Or, if you prefer Perl,
perl -pi -e 'y;\r;;d;' f1
Thanks for explaining it.
Andrew Sweger <andy at n2h2.com> | N2H2, Incorporated
v=206.336.2947 f=206.336.1541 | 900 Fourth Avenue, Suite 3400
Advanced Technologies | Seattle WA 98164-1059
Development | http://www.n2h2.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
Email to majordomo at pm.org: ACTION spug-list your_address
More information about the spug-list