^m


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ^m
# 1  
Old 06-26-2001
^m

HI, I am totally new here, but I think I have come to the right place. I am a Microsoft programmer who doesn't know squat about UNIX, but need to write some unix scripts on the double. I have a short script that I want to invoke from the command line. I have the file in which I wrote this:

cd ~/exe/dir1/dir2
programName arguments > outputFile

I invoke this file from the command line and I get an error at line 1 saying "/usr/me/exe/dir1/dir2^M" does not exist. I assumed that since I used notepad to create the file from my laptop that there was an end of line character that got transferred across OSs. So, I went to the machine and used nedit to create a new file, but got the same error. (REALLY trying to avoid vi until I have more time....) What is my problem?

Thanks in advance

KB
# 2  
Old 06-27-2001
As far as I can remember ^M is a carriage return, which means you have a control character at the end of that command which you don't want. I know this is not want you wanted to hear but I would open it up using vi or similar editor and take a proper look at the specific line.

You always have to start with vi at some point Smilie

Regards.
alwayslearningunix
# 3  
Old 06-27-2001
if you are on solaris you can use a utility called: dos2unix

Code:
#dos2unix orig-file orig-file.new

and this will take care of your ^M problem.
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question