This is one of the oldest irritations in computing.
DOS ends lines with 0D 0A but linux and unix just use 0A.
This script should fix you up if you have a modern sed:
cat linux.script | sed 's/.*/&\x0D/' > dos.script 
If you have an older sed, this might work:
cat linux.script | sed 's/.*/&\r/'  > dos.script
You can check this out with:
od -a linux.script
od -a dos.script
Similar fixes can be done with awk, but I have forgotten how to use it.
Going dos to linux is easier:
cat dos.script | tr -d"\r" > linux.script
I haven't tried running such converted scripts, so YMMV.
Joel

> 
> the problem is that whenever i create the batch file in linux 
> using vi or any text editor, the script cannot be executed and,
> my friend told me that i need a program that would convert the
> batch script created in linux to have dos commands. Does anyone
> of such package/program? Or does anyone know an easier way to do
> this?
> 
> 
> As of now i have to create all the scripts for all the users in notepad,
> so that it can be executed, then copy it to the the netllogon directory 
> of my samba server.
> 
_______________________________________________
http://linux.nf -- [EMAIL PROTECTED]
Archives, Subscribe, Unsubscribe, Digest, Etc 
->http://linux.nf/mailman/listinfo/linux-users

Reply via email to