![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Print Problem in UNIX. Need to know the option to specify the print paper size | ukarthik | HP-UX | 1 | 06-07-2007 06:35 AM |
| Print problem | Vijay11 | AIX | 1 | 09-14-2005 12:03 AM |
| Problem with print queue | carell | UNIX for Dummies Questions & Answers | 1 | 08-30-2005 08:00 PM |
| Problem deleting print job | sgtdmc | UNIX for Dummies Questions & Answers | 2 | 06-16-2005 02:08 PM |
| Print Problem | Mark Duncan | UNIX for Dummies Questions & Answers | 2 | 10-11-2001 05:08 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Problem with print command
Hi,
I have a small script and am having problem at one point. The script runs another script called Run_SQL.sh. All I am trying to do is if the return code from the script is not zero(0) then display some message(which is working fine) and if the return code is zero then run the SED command and run the print command below it.(see in RED BOLD below). My SED command executes fine but the print command sometime works and sometime does not work. Its sporadic. I know there is something very simple but am not able to figure out. Any advice will be appreciated. SQLDIR=$t_path SQLLISTFILE=${t_path}/$SQLFILE for SQLNAME in `cat $SQLLISTFILE` do SQLFILENAME=${SQLDIR}/${SQLNAME} print "Running ${SQLNAME}" Run_SQL.sh -f $SQLNAME if [ $? -ne 0 ] then print "There is error in ${SQLNAME}. Check the file." exit -1 else var=`head -1 ${SQLLISTFILE}` if [ "$var" == "$SQLNAME" ] then sed '1d' ${SQLLISTFILE} | tee ${SQLLISTFILE} > /dev/null 2>&1 --->This command executes fine print "${SQLNAME} ran sucessfully" --->This is where I am having problems. This command sometime displays and sometime does not displays text. fi fi The command in bold above run sucessfully and sometime it does not show up at all even if the sed command is sucessful. I have to run this print command after the sed command only. I will really appreciate any advice in this regard.
__________________
Thanks Raj |
| Forum Sponsor | ||
|
|
|
|||
|
Problem with the SED and TEE command
Hi,
I am sorry, I could not able to understand. The file I am reading has bunch of sql filenames. Something like: test1.sql test2.sql test3.sql test4.sql All I am trying to do is to delete the first line from the file on each iteration of the loop and refresh the file, so that the I can read the next sql filename. Is there an example I can see in how to fix this. Will appreciate any help on this. Thanks
__________________
Thanks Raj |
|||
| Google The UNIX and Linux Forums |