how can i run this command (getDisk -f -a)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how can i run this command (getDisk -f -a)
# 1  
Old 03-06-2008
how can i run this command (getDisk -f -a)

i want to be able to use multiple positional paramteres on the command line. For example the name of my script is getDisk and when i run getDisk -u it runs the function getUSB and it gives me output of the usb disk name c2t0d0s0. I am still working on the getFC function to find fibre channel devices but in the meantime i have the function printing out a string.

why is it when i run getDisk -f -a i only get "hello"?

getFC
{
echo "hello"
}

while getopts hisuf:a OPTION
do
case $OPTION in
s) getSCSI ;;
f) getFC ;;
a) echo "something";;
u) getUSB ;;
i) getInternal ;;
h) Usage ;;
\?) echo "$0: $OPTARG is an invalid option!"
exit 2 ;;
esac
done
# 2  
Old 03-06-2008
How do you pass to the second argument? arent you missing some "Shift"?

Regards
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check who run the command?

Dear Team, i need to know in linux if someone run the command in linux server where i can check on server . i need to know the below points who (user) when (date and time) what (command) regards, scriptors (1 Reply)
Discussion started by: scriptor
1 Replies

2. AIX

How to use dsadm command to run command on multi lpars?

how to run a command, such as "ls -l core" from one lpar to check multi lpars if core file exist? or what way can do a command on all lpars from one lpar? Thanks (1 Reply)
Discussion started by: rainbow_bean
1 Replies

3. Shell Programming and Scripting

Run command without over-writing

I have a script called script.sh that has the following in it. cat /home/auto/script.sh #!/bin/bash ARGA=$1 if ; then echo "${ARGA}:Confirmed" else echo "${ARGA}:Unconfirmed" fi I need a way to run this script, and then, after script has confirmed the... (9 Replies)
Discussion started by: SkySmart
9 Replies

4. Shell Programming and Scripting

Script to run command one by one

Hi, I have run a lot of commands one after one, but I can't run them simultaneous. One command has to run and when finished second command has to run etc. Also I would like to save all the outputs created by the commands in a file. The commands can sometimes take hours, so it is also... (10 Replies)
Discussion started by: misterx12345
10 Replies

5. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

6. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

7. Shell Programming and Scripting

Is command line invocation of gnome-terminal to run more than one command possible?

Hello, I am trying to learn how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ______________________________________________ ${0##*/} run... (0 Replies)
Discussion started by: Narnie
0 Replies

8. UNIX for Dummies Questions & Answers

Help run ls command along with find command

Hi, I want to run ls -lrt command along with find command. I want to get the list of files with timestamp, owner, group and permissions for the files larger than 1024k. I tried the below command, but it displays only the file names. ls -lrt | find . -name "*.*" -size +1024k -print Any... (7 Replies)
Discussion started by: TonySolarisAdmi
7 Replies

9. UNIX for Dummies Questions & Answers

How to run multiple command in single command?

Dear Unix Guru, I have several directories as below /home/user/ dir1 dir2 dir3 Each directory has different size. I want to print each directory size (Solaris command du -hs .) Can you please guide me how to achieve this? Thanks Bala (2 Replies)
Discussion started by: baluchen
2 Replies

10. UNIX for Dummies Questions & Answers

command to run a command after 30 mins

how to schedule a command to run after 30 mins ? (3 Replies)
Discussion started by: gridview
3 Replies
Login or Register to Ask a Question