[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A file is not always what you think it is.



Synopsis:  file, created in Windows, won't execuate as shell script on
Linux box.

Here is an 'od' dump of the first line of the file:

> 0000000   #   !   sp   /   b   i   n   /   s   h   cr   nl

The trick here is to get rid of the newlines.  The easiest way I know
of is to use the 'fromdos' program, located in the 'sysutils' package.

Just run

$  fromdos file

and the newlines go away.


For fun, you can run 'todos' on a working shell script -- it will stop working.
Run 'fromdos' on it -- it will start working again.


Carl



Reply to: