![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing runtime arguments to a shell script... | santy | Shell Programming and Scripting | 10 | 01-09-2009 10:47 PM |
| Passing arguments to a shell script from file while scheduling in cron | weblogicsupport | SUN Solaris | 4 | 01-27-2008 11:16 PM |
| Passing arguments to a Perl script | jyoung | Shell Programming and Scripting | 4 | 12-29-2004 05:57 PM |
| Passing arguments to a script | Kevin Pryke | Shell Programming and Scripting | 3 | 06-14-2002 09:06 AM |
| passing arguments | jpprial | UNIX for Dummies Questions & Answers | 4 | 04-03-2001 11:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Passing blank arguments to a script
All,
I have a cron job script that receives several command line arguments. At some point if there are validation problems and the job cannot be run, it duplicates the entire command line into a temporary text file which is later executed as a script. Unfortunately when I pass the list of received arguments (ie: $*) to this new file, the quoted blank arguments are dismissed. For example, my script "runbatch.sh" looks like this: #!/bin/ksh #runbatch.sh if [ some validation fails ] then echo "$0 $*" >> retryjobs.sh exit 1 fi If runbatch.sh was run as: runbatch.sh one two '' four five It will convert the 2 single quotes to a blank when exporting the line to retryjobs.sh, thus removing the blank argument. Here's what retryjobs.sh looks like: runbatch.sh one two four five I need those single quotes to be passed. Any ideas anyone?? Thanks |
|
||||
|
Thanks for the tip - I never tried man on ksh - kool
![]() Unfortunately either "$@" or "$*" produce an unquoted double space ![]() How about trying to replace this double space with [space] [quote] [quote] [space]. The 'tr' command doesn't seem quite fit to handle this. Remains 'sed' but I am not very familliar with it. Please help with the correct syntax: echo "$@"|sed ??? >> retryjobs.sh Thanks. Réal |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|