Editor dependent error?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Editor dependent error?
# 1  
Old 02-17-2006
Editor dependent error?

Hi all,

i did typed the following code in vi and executed it.
#!/bin/sh
//notice the blank line here.
DATA=test
echo "$DATA"

There was no problem.

I then deleted the file using the rm command. I used ultraedit typed in the same file. , FTP it in and i got the following output
: command not found
test

I then edited the file using ultraedit, and removed the blank line, this time, i did not get the " command not found error".
i re tried on ultra edit, this time the following piece of code:
#!/bin/sh
//notice the blank line here.
//notice the 2nd blank line here.
DATA=test
echo "$DATA"

the output i got was
: command not found
: command not found
test


It seems the number of blank lines i entered using ultraedit will cause the corresponding number of :command not found message when i executed the script. However, this does not happen when i use vi. Any insights?
# 2  
Old 02-17-2006
After you ftp the script, do a dos2unix on the script, and then run it.

The reason could be the extra \r characters at the end of each line.
# 3  
Old 02-17-2006
Thanks for pointing out the cause, Vino.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vi editor Line too Long Error

My file is 13 mb but it has big long lines. i tried in vain vi -R filename I tried in vainbash: vim: command not found SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4vCan you please suggest? (1 Reply)
Discussion started by: mohtashims
1 Replies

2. Solaris

Is ntpdate command dependent on ntpd?

Hi, Could someone Please clarify me here: Is ntpdate command a part of ntpd, i mean does ntpdate command a dependent on ntpd? and can ntpdate be run in absence of ntpd service. (5 Replies)
Discussion started by: aksijain
5 Replies

3. AIX

Dependent modules libc.a and libpthreads.a

Hello I am trying to install ActivePerl Pro Studio and I am seeing the following errors. Could not load program ./setup: Symbol resolution failed for setup because: Symbol ___memcmp (number 1) is not exported from dependent module /usr/lib/libc.a(shr.o). ... (2 Replies)
Discussion started by: flagman5
2 Replies

4. UNIX for Advanced & Expert Users

AIX Dependent Module could not be loaded

I am encountering the above error , even after setting the environment variables correctly AFAIK. I've found sources that say LIBPATH is the shared library variable , and others that say LIB_PATH, so I set both: ========================= root@lipossrp01ga: # echo $gtm_dist ... (6 Replies)
Discussion started by: Clovis_Sangrail
6 Replies

5. Programming

Machine dependent problems when using Sockets.

I am trying to write code for a client-server scenario using AF_INET sockets.. As is usually the case, everything works fine and dandy on my machine, but gives me the following error at runtime: send: Socket operation on non-socket The error is thrown by the server when trying to send the... (5 Replies)
Discussion started by: ab_tall
5 Replies

6. Slackware

Context dependent symlinks

Ive got multiple PCs, sharing an NFS mounted home dir. For certain apps I would like to keep the config files host specific. Easy solution is to create symlinks to local folders for configs. Ideally I would still want the .config files to reside in the user home folder. Is it possible to... (2 Replies)
Discussion started by: agentrnge
2 Replies

7. UNIX for Dummies Questions & Answers

Terminal too wide error in vi editor.

Hello, I get the error "Terminal too wide" when I use vi editor on a Solaris 10 box. Please help. bash-2.05$ vi rman_backup_prd571.log_20090611 Terminal too wide :q 1 more file to edit:q Regards, Mahive. (1 Reply)
Discussion started by: mahive
1 Replies

8. UNIX for Advanced & Expert Users

getting error when open vi editor

helo I install my product for koren language I m uisng RHEL -4 operating system now problem is whenever I open any file vi filename I got following error on the screen E557: Cannot open termcap file 'vt100' not known. Available builtin terminals are: builtin_ansi ... (1 Reply)
Discussion started by: amitpansuria
1 Replies

9. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

10. HP-UX

how can i make two dependent jobs into cron?

Hi all, How can i make two dependent jobs into crontab? means after the first job the second job should run in a single crontab entry in unix. (1 Reply)
Discussion started by: megh
1 Replies
Login or Register to Ask a Question