|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | 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 and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Call a perl script inside a shell script
Hi all,
I have the following snippet of code.. #!/bin/sh echo "run perl script............" #Run the verification script perl bill_ver echo " perl script completed....." echo "rename files......" #Remove from all file in the directories test, test1, test2, test3 for f in /usr/users/rovolis/test/*.tmp ; do newfile=`echo $f | sed 's/\(.*\)..../\1/'` ; mv $f $newfile ; done echo "rename completed....." The perl script returns '0' if it is completed successfully or non-zero if not. What i would like is to perform the rename only if the perl script is completed successfully. How am i going to check this? Thank you very much for your help |
| Sponsored Links | ||
|
|
|
|||
|
#!/bin/sh
echo "run perl script............" #Run the verification script perl bill_ver ret_val=$? echo " perl script completed....." if [ "$ret_val" -eq 0 ] then echo "rename files......" #Remove from all file in the directories test, test1, test2, test3 for f in /usr/users/rovolis/test/*.tmp ; do newfile=`echo $f | sed 's/\(.*\)..../\1/'` ; mv $f $newfile ; done echo "rename completed....." fi |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| invoking a shell script inside cgi shell script | smriti_shridhar | Shell Programming and Scripting | 2 | 07-09-2008 02:50 AM |
| Run the command inside perl script | vinay123 | Shell Programming and Scripting | 1 | 06-13-2008 11:01 AM |
| here document to automate perl script that call script | hogger84 | Shell Programming and Scripting | 3 | 10-22-2007 11:15 AM |
| How to call a perl script from a shell script | anumkoshy | Shell Programming and Scripting | 2 | 08-30-2007 05:23 AM |
| calling a C executable from inside a Perl script | mark_nsx | Shell Programming and Scripting | 3 | 10-07-2005 06:49 AM |