![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | 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 |
| run shell script from oracle store procedure | arnabb4u | Shell Programming and Scripting | 8 | 08-16-2006 09:16 AM |
| How to run an SQL script inside a shell | stevefox | Shell Programming and Scripting | 1 | 06-15-2006 07:11 PM |
| How to run unix commands in a new shell inside a shell script? | hkapil | Shell Programming and Scripting | 2 | 01-04-2006 02:56 AM |
| Using tar inside a shell script | kas7225 | Shell Programming and Scripting | 2 | 05-19-2005 08:06 PM |
| Store return code of shell script in oracle table | sveera | Shell Programming and Scripting | 3 | 05-04-2005 10:25 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
How to store the outputs of a shell script inside a log file???
My shell script file name is test.sh and the contents of this test.sh file are
Code:
ps_file="package1.ps" echo $ps_file ps_file1=`echo $ps_file| sed "s/.ps//g"` echo $ps_file1 ps2pdf -dSAFER -sPAPERSIZE=a4 /tmp/A380_RFS24/amm_r0_ps/$ps_file1.ps /tmp/A380_RFS24/amm_r0_pdf/$ps_file1.pdf For this i have written the following command Code:
test.sh > test.log Can i do this one like the following ways???? Code:
ps_file="package1.ps" echo $ps_file > test.log ps_file1=`echo $ps_file| sed "s/.ps//g"` echo $ps_file1 > test.log ps2pdf -dSAFER -sPAPERSIZE=a4 /tmp/A380_RFS24/amm_r0_ps/$ps_file1.ps /tmp/A380_RFS24/amm_r0_pdf/$ps_file1.pdf > test.log Last edited by Yogesh Sawant; 03-20-2008 at 03:23 AM. Reason: added code tags |
| Forum Sponsor | ||
|
|
|
|||
|
use the redirection operator >> instead of >
eg: ls -ltr >> abc will throw all the outout to abc and the next time when you do pwd >> abc the previous output willl be appened to the new output Hope this answers your question.. Thanks Antony cecil |
|
|||
|
You may use the following in ur script ...
Code:
logfile=test.log
ps_file="package1.ps"
echo $ps_file
ps_file1=`echo $ps_file| sed "s/.ps//g"`
echo $ps_file1
ps2pdf -dSAFER -sPAPERSIZE=a4 /tmp/A380_RFS24/amm_r0_ps/$ps_file1.ps /tmp/A380_RFS24/amm_r0_pdf/$ps_file1.pdf
exec 1>${logfile}
exec 2>&1
This will redirect the standard o/p(indicated by 1) and standart error ( indicated by 2) to the test.log file.
|
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|