10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am trying to execute the cli.sh script in another shell script passing arguments and getting the below error.
/home/runAJobCli/cli.sh runAJobCli -n $Taskname -t $Tasktype
I am passing the below 2 arguments and it giving error
./Myscript.sh T_SAMPLE_TEST MTT... (11 Replies)
Discussion started by: Info_Geek
2. Shell Programming and Scripting
I need help in understanding the default value for getopts option's argument in ksh. I've written a short test script:
printf "Usage: -v and -m are mandatory\n\n"
while getopts ":v#m:" opt; do
case $opt in
... (1 Reply)
Discussion started by: da1
3. Shell Programming and Scripting
I am using below code in AIX env to interpret -n option given in argument while executing the script .I want to give another argument -t
while getopts ":n:" opt; do
case "$opt" in
*)... (3 Replies)
Discussion started by: Vishal_dba
4. Shell Programming and Scripting
I have got to the point where I can specify the arguments but how to pass an option is still mystery to me. Example:
temp.csh a b c d
set temp1 = $argv
set temp2 = $argv
set temp3 = $argv
temp.csh a b c d -S 1
set temp1... (2 Replies)
Discussion started by: dixits
5. Boot Loaders
I am doing PXE boot for my GNU/Linux device and pxelinux.0 loads the kernel as well as initrd images I have mentioned in the config file but it looks like it is not considering the init= option. Instead it starts the default INIT program.
I wanted my customized init program to be... (3 Replies)
Discussion started by: learn more
6. Shell Programming and Scripting
hi, here is a ksh script i wrote using getopts...
i want to find out how i can run it in default mode when no option is mentioned and no arguments are provided... ?
i.e if the script name is final1, then just running final1 should run in default mode....
while getopts 1:2:3:4: mode ... (1 Reply)
Discussion started by: pravsripad
7. Shell Programming and Scripting
I have a script with several options and during testing I found that the \? option does not handle options without dashes as I would expect. Then I run the script with any option that does not include a dash, it runs the script when I would expect \? to catch it and error.
I've tried this with... (2 Replies)
Discussion started by: HexKnot
8. Shell Programming and Scripting
Does getopts have some way of handling the use of an option that requires a parameter more than once on the command line.
e.g. mycmd -a john -a jane
I came up with a solution using arrays (shown below), but wonder if getopts has some other way of handling it. Other solutions... (2 Replies)
Discussion started by: CarlosNC
9. Shell Programming and Scripting
I have a script that ran perfectly on Solaris 5.8
However after upgrade to Solaris 5.10 it started failing.
I invoke the script as below:
./TestScript3.ksh --dir $APP_DATA_IN_OLD $NDM_DATA/$NEXT_FILE
When i execute it i get the following error "getopts: dir bad option(s)".
Please let... (1 Reply)
Discussion started by: JoeJoseph
10. Shell Programming and Scripting
Is it possible to use getopts and also receive arguments without option flags?
e.g. myscript arg1 arg2 -a arg3 -b arg4
If so, how do you stop getopts from exiting as soon as it detects the non-option arguments? (2 Replies)
Discussion started by: kdelok