Shell - a small error! :(


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell - a small error! :(
# 1  
Old 07-15-2007
Shell - a small error! :(

# doloadsfs.sh - load scribe data into new SFS files
for s in c e f h m
do
for f in 0001 0002 0003 0004
do
hed -n ma$s.$f.sfs
slink -isp -f 20000 c:/data/scribe/scribe/dr1/mt/ma$s/a${s}pa$f.pes \
ma$s.$f.sfs
anload -S c:/data/scribe/scribe/dr1/mt/ma$s/a${s}pa$f.pea ma$s.$f.sfs
done
done


________________________________________________________________

I get these errors:
$ sh doloadsfs.sh
doloadsfs.sh: line 3: syntax error near unexpected token `$'do\r''
'oloadsfs.sh: line 3: `do

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __

Can any1 please tell me the correct script for this to run.
Thanks
# 2  
Old 07-16-2007
1. do you have "#!/bin/sh" at the start?
2. use CODE tags to ensure faithful formatting of script when posting
# 3  
Old 07-16-2007
i did try wat u said even before i posted it..

I think it has to do something wid the 'for' or the 'do' statement...

the bin statement in the first line dint make a difference.
# 4  
Old 07-16-2007
I think that your script may have carriage-returns or other control characters.
# 5  
Old 07-16-2007
Is it possible for you to elucidate?
If possible can u please post my script with the possible changes u think should be implemented. Thanks.

Arun
# 6  
Old 07-16-2007
Code:
#!/bin/sh
# doloadsfs.sh - load scribe data into new SFS files
for s in c e f h m
do
    for f in 0001 0002 0003 0004
    do
        hed -n ma$s.$f.sfs
        slink -isp -f 20000 c:/data/scribe/scribe/dr1/mt/ma$s/a${s}pa$f.pes \
                                                            ma$s.$f.sfs
        anload -S c:/data/scribe/scribe/dr1/mt/ma$s/a${s}pa$f.pea ma$s.$f.sfs
    done
done

Quote:
Originally Posted by abrox
doloadsfs.sh: line 3: syntax error near unexpected token `$'do\r''
The \r is the giveaway of embedded carriage returns.
# 7  
Old 07-16-2007
Getting the same error in the 4th line now...

jus that u included the bin statement
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Small Error while copying

Hello Gurus, I am getting an error when i am running the below script: # cat test #!/bin/bash ti=/home ls -1rt /home/jinny/html > /tmp/apafiles xargs cp -R -t $ti/ji < /tmp/apafiles cp: cannot stat `smscconf_lra.html': No such file or directory cp: cannot stat... (3 Replies)
Discussion started by: hitesh1907
3 Replies

2. Shell Programming and Scripting

small error in shellscripting -archival part

Hi All, I have run the below script but getting one small error. please help me to solve this. ERROR: tar: Error exit delayed from previous errors CODE: #! /bin/bash CEP=/home/user01/exercise/CEP ARCH=/home/user01/exercise/archive LOG=/home/user01/exercise/logs... (3 Replies)
Discussion started by: aish11
3 Replies

3. UNIX for Dummies Questions & Answers

help needed with a small shell script!

I have a scenario where i need to look for files of these kind filename.log.0 filename.log.1 if the files are present, then no action is to be taken, if not found, then it shud create/touch files with the same name. so can anyone help constructing the script for me..appreciate ur help. ... (5 Replies)
Discussion started by: win4luv
5 Replies

4. Shell Programming and Scripting

Write a small shell script

Hello Forum members, Have a nice day. I have to write a script for the following below scenario. There are 3 applications located in home directory(ie xyz/app) which have multiple directories and files of diff format(.sh,log,other formats). Case 1: I have to find the hardcoded... (8 Replies)
Discussion started by: rajkumar_g
8 Replies

5. Shell Programming and Scripting

Please help to debug a small shell script (maybe AWK problem)?

Hi Buddies, The following is shell scripts which was borrowed from linux box for load average check. it runs good. (this structure is simple, when load average is too high, it will send alert to user) #!/usr/bin/ksh # Set threshold for 1, 5 and 15 minture load avarage # configured for... (4 Replies)
Discussion started by: GreatJerry
4 Replies

6. Shell Programming and Scripting

Small shell script help required

Hi Guys, Please can some one explain me the below part of code. In this code what is the use of the line in Bold. COPY=0 if ; then echo "$CONF exists and is non-empty - backing it up" SUFFIX=`date +%Y%m%d%H%M%S` echo "cp -p $CONF $CONF.$SUFFIX" cp -p $CONF... (4 Replies)
Discussion started by: max29583
4 Replies

7. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

8. Shell Programming and Scripting

Very small Shell Script Help...

The following Script takes each extension and determine what category it belongs and then moves it into a directory based on the extension. (for eg. 1.sh, 5.sh, 9.sh together; 4.csh, 120.csh, 6.csh together and 7.ksh, 2.ksh, 59.ksh together) and moves them to their respective directories viz.... (2 Replies)
Discussion started by: marconi
2 Replies

9. Shell Programming and Scripting

what is problem with this small shell script.. case statement related

Hi All, this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem. #!/bin/bash echo "Enter the character" read a case $a in )... (2 Replies)
Discussion started by: johnray31
2 Replies
Login or Register to Ask a Question