You can take this a step further by using a check sum. Say you have 5 or 10 required flags, you could accomplish this by keeping track of those arguments you have already processed by using a counter. Check the value of the counter at the end to verify all flags were received.
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Hi,
I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP.
I want the oids for above tasks.
can you please tell me that
Thank you (2 Replies)
Hi
I'm learning how to add in programm another option by command line.
For example in the "my_prog" i want to add a " -k " option and then write a number.
I mean:
my_prog -k 50
and the i should use the number 50.
I'm reading about getopt_long and optarg, and what i have done in the code... (0 Replies)
Hi I have below code in one of my shell script:
if ; then fail $USAGE; fi
while getopts hz:r:t:dz: o
do
case "$o" in
h) echo $USAGE ; exit 0;;
r) export REQ_ID="$OPTARG";;
t) TIMESPAN="$OPTARG";;
d) detail="true";;
) ... (0 Replies)
Hi there,
I hope, that I do not open an thread, that is already existing, but I didn't found something matching with my problem while searching for problems with "getopts"
My problem ist, that I'm taking arguments from commandline into my script with getopts, I've an flag -s, after that there... (2 Replies)
here is the code
echo begin
while getopts 1:2:3:4: mode
do
case $mode in
1)echo "You have chosen mode1"
case $OPTARG in
a) echo "User Specified Date Range"
rangelist.sh ;;
b) echo "user specified month and year";;
?) echo "Default, Current... (4 Replies)
Hi all,
Can you please tell me the command, with which one can know the amount of space a specific directory has used.
df -k . ---> Displays, the amount of space allocated, and used for a directory.
du -k <dir name> - gives me the memory used of all the files inside <dir>
But i... (2 Replies)
EDIT: -- SOLVED --
Heyas,
Getting used to optargs, but by far not understanding it.
So i have that script that shall be 'changeable', trying to use the passed arguments to modify the script visuals.
Passing:
browser -t test -d sect $HOME
Where -t should change the title,
and -d... (0 Replies)
Hi,
I want to capture space as well from the argument
eg:
script.ksh -m "Message from xyz" -e "email@xyz.com"
script.ksh -m 'Message from xyz' -e 'email@xyz.com'
I am parsing using getopts, but for option "m" OPTARG is returning only "Message".
Please use code tags next time for... (9 Replies)