Getting unexpected error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting unexpected error
# 1  
Old 07-25-2011
Getting unexpected error

Hi All,

I am writing one script to automate one of the process and for that I am using below command at one line :

uncompress `cat tmp`

content in tmp file are :

/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02108.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02109.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02110.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02111.DAT.Z

this path and file names are correct I checked it manually but still I am getting error - A file or directory in the path name does not exist.

Can somebody please guide me I am tring to fix this from last 3 days..Smilie

thanks
# 2  
Old 07-25-2011
This should be no problem - either the way you tried it or with having cat piping it to xargs. Did you try a simple
Code:
ls /home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02108.DAT.Z

?
Do you get more information about the error when you add a -v to your uncompress?

Please use code tags when posting code, data or logs, thanks.
# 3  
Old 07-25-2011
Thanks zaxxon for your reply
I am getting correct output for
Code:
ls /home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02108.DAT.Z

and if I am executing
Code:
 uncompress `cat tmp`

from command window it is running fine but when i am using this statement in script it is showing me error, so do you have any idea what may be the cause ??
# 4  
Old 07-25-2011
Ah ok, different situation then. It seems that it can't find tmp which should be either used with absolute path or your script has to be executed from the directory level above tmp so that it could be found.
# 5  
Old 07-25-2011
Both are from the same directory see the output..
Code:
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02108.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02109.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02110.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02111.DAT.Z
/home/vas/aqbatch/newbatch/archive/output/RIM_GUIDEPRICE_AQ_02112.DAT.Z: A file or directory in the path name does not exist.

# 6  
Old 07-25-2011
Is this a directory where the files are often moved, renamed or deleted etc., ie. is there a lot of "traffic" in it?
Is there a filename already in the list "tmp" when it is not already existent in the folder?

Next time you issue uncompress ..., try following and post it's output:
Code:
VAR=/home/vas/aqbatch/newbatch/archive/output
cat tmp
echo '-----------------'
ls -la $VAR
echo '-----------------'
uncompress `cat tmp`
echo '-----------------'
ls -la $VAR

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Getting this error syntax error near unexpected token `)'

Hi Everyone, my script was running Ok, but suddenly it started giving this error. ./update_env_bi.sh: line 54: syntax error near unexpected token `)' ./update_env_bi.sh: line 54: `sed -i "s/PORT=*1/PORT=$2/" repository.xml' The line 54 has this code. sed -i "s/PORT=*1/PORT=$2/"... (2 Replies)
Discussion started by: shajay12
2 Replies

2. Shell Programming and Scripting

Syntax error `(' unexpected

I have written this in my script but while running i am getting syntax error `(' unexpected. unload to "$BACKUP_DIR/n_fac_fid-$clliname" select * from n_fac_fid where fac_accesskey in (select fac_accesskey From n_fac_ap_fid where ap_clli="$clliname"); Any help appreciated. (3 Replies)
Discussion started by: suryanmi
3 Replies

3. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies

4. Shell Programming and Scripting

syntax error: `$' unexpected

Hi all, Am very new to Unix and am currently Involved in Migrating some Shell Scripts from AIX 4 to Solaris 10. While using teh for loop am getting the below error: $ echo $SHELL /usr/bin/ksh $ for file in $(ls *SEBE*) syntax error: `$' unexpected while the same works without issue on... (4 Replies)
Discussion started by: paragkhanore
4 Replies

5. Solaris

Unexpected error

When I typed #svcs -x sma I received this following error, svcs: svcs.c:335: Unexpected libscf error: invalid argument. Exiting. I have googled around but could not find a solution. IS this a bug? I am using Solaris 5.10 Generic_137137-09 sun4v sparc... (2 Replies)
Discussion started by: sundar63
2 Replies

6. Shell Programming and Scripting

unexpected syntax error

Hi, i am getting following syntax error ...kingly advice why is it coming ?? #!/bin/bash find . -name "common.log" if ; then echo "1" fi Himnashu@home /bin $ ./a.sh ./a.sh: line 7: syntax error near unexpected token `fi' ./a.sh: line 7: `fi' (9 Replies)
Discussion started by: himvat
9 Replies

7. Shell Programming and Scripting

sed error : Syntax error: redirection unexpected

My script is throwing the error 'Syntax error: redirection unexpected' My line of code.. cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3 HTML tags are getting in the way but they're needed to... (3 Replies)
Discussion started by: phpfreak
3 Replies

8. Shell Programming and Scripting

unexpected crontab error

Yesterday i installed a new cron on solaris box. After a few minutes after loading the cron, i got the following error. Your "crontab" on machine_name ! unexpected end of line This entry has been ignored. Do any of you have any idea about this error ? (12 Replies)
Discussion started by: dhanamurthy
12 Replies

9. UNIX for Dummies Questions & Answers

unexpected error

./sample.5: syntax error: `(' unexpected I get this error and Im trying to solve it but the line that it refering to is a notation so I don't understand why it is affecting the program. (2 Replies)
Discussion started by: helpme2008
2 Replies

10. 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
Login or Register to Ask a Question