Sponsored Content
Full Discussion: Help with getopt
Top Forums Shell Programming and Scripting Help with getopt Post 302256296 by giorgos193 on Sunday 9th of November 2008 08:11:59 AM
Old 11-09-2008
How could i enforce multiple option?

Ok... it seems to be too difficult for me.... I should probably give up on this...

I'll try to implement differently my code! Thanks a lot for your response!

Last edited by giorgos193; 11-09-2008 at 09:47 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getopt help

scriptname i have made a script to perform so tasks and i managed to complete the tasks for all the options the problem i am facing is that i can run the scripts individually but i would like to make it such that it can accept multiple options and give me the appropriate output e.g.... (1 Reply)
Discussion started by: problems
1 Replies

2. Shell Programming and Scripting

getopt

#!/bin/sh set -- `getopt "abco:" "$@"` a= b= c= o= while : do case "$1" in -a) a=1;; -b) b=1;; -c) c=1;; -o) shift; o="$1";; --) break;; esac shift done shift # get rid of -- # rest of script... # e.g. ls -l $@ (6 Replies)
Discussion started by: Hitori
6 Replies

3. Shell Programming and Scripting

getopt help

I m trying to use getopt This is my script, but it doesn't take argument in variable, Please help. set - - `getopt mscl: $*` if then echo "Exiting...." exit 2 fi for i in $* do case $i in -m) MAIL="$i"; shift;; -s) SCRIPT=$OPTARG; shift;; -c) COB=$OPTARG; shift;;... (2 Replies)
Discussion started by: darshakraut
2 Replies

4. Shell Programming and Scripting

getopt help

:) Can anybody help me about how to use getopt in shell scripting. (3 Replies)
Discussion started by: darshakraut
3 Replies

5. Shell Programming and Scripting

getopt in perl

Hi, I have a perl script with two functions say func a and func b. sub a { ----------- --------- } sub b { --------- --------- } I want to use this function on command line as we can do in shell script using getopt. My motto here is to run the script like this ... (7 Replies)
Discussion started by: namishtiwari
7 Replies

6. Shell Programming and Scripting

Help with Getopt::Std

I am working on a script that lists files in a directory with a few file attributes depending on what option the user specifies at the command prompt. The script uses Getopt::Std and takes two switches. The first switch allows the user to specify a directory, the second switch gives a long... (3 Replies)
Discussion started by: Breakology
3 Replies

7. Shell Programming and Scripting

Use of getopt with and without argument

Hi, I am in middle of using some getopt command and am finding some issue. The usage of my script can be like this: abc.sh <-d | -p |-r> -online < 0 | 1> The first argument can be either -d or -p or -r. The second argument can be either -s and a id or a file name. So I am stuck up in writing... (2 Replies)
Discussion started by: sachin.ag
2 Replies

8. UNIX for Dummies Questions & Answers

Using Getopt Option

Hi I need to use getopt option and I have no idea what it is or how to use it. I need to use it on this awk script: awk -F, -v cellid="$1" -v paramval="$2" -v oldfile="$3" -v newfile="$4" '$2==cellid{$3=newvalue}1' OFS="," $3 > $4 I tried reading up on it but I just confuse... (2 Replies)
Discussion started by: ladyAnne
2 Replies

9. Shell Programming and Scripting

getopt in CSH

I am struggling to understand how getopt can be used in a csh script. can anybody post a csh script using getopt. Please! (4 Replies)
Discussion started by: animesharma
4 Replies

10. Shell Programming and Scripting

Getopt Help

Hi All, An old work friend wrote a script which I've been trying to understand how a section of it currently works and work out how i can add some command line switches which i can use later in the script to append the output depending on the command line arguements. Currently it works by... (1 Reply)
Discussion started by: mutley2202
1 Replies
SMP_REP_SELF_CONF_STAT(8)					     SMP_UTILS						 SMP_REP_SELF_CONF_STAT(8)

NAME
smp_rep_self_conf_stat - invoke REPORT SELF-CONFIGURATION STATUS SMP function SYNOPSIS
smp_rep_self_conf_stat [--brief] [--help] [--hex] [--index=SDI] [--interface=PARAMS] [--last] [--one] [--raw] [--sa=SAS_ADDR] [--verbose] [--version] SMP_DEVICE[,N] DESCRIPTION
Sends a SAS Management Protocol (SMP) REPORT SELF-CONFIGURATION STATUS function request to a SMP target. The SMP target is identified by the SMP_DEVICE and the --sa=SAS_ADDR. Depending on the interface, the SAS_ADDR may be deduced from the SMP_DEVICE. The mpt interface uses SMP_DEVICE to identify a HBA (an SMP initiator) and needs the additional ,N to differentiate between HBAs if there are multiple present. OPTIONS
Mandatory arguments to long options are mandatory for short options as well. -b, --brief lessen the amount of header information output and compress each self confuration status descriptor to one line of output. -h, --help output the usage message then exit. -H, --hex output the response (less the CRC field) in hexadecimal. -i, --index=SDI SDI is the starting self-configuration status descriptor index, an integer in the range 0 to 65535. The default value is 1 . If SDI is 0 then no descriptors are placed in the response plus the "starting self-configuration status descriptor index" and "total number of self-configuration status descriptors" fields in the response are both set to 0. That makes setting SDI to 0 a lot less useful tha it could have been. SDI may be decimal (default) or hexadecimal prefixed by '0x' (or '0X') or with a 'h' (or 'H') suffix. -I, --interface=PARAMS interface specific parameters. In this case "interface" refers to the path through the operating system to the SMP initiator. See the smp_utils man page for more information. -l, --last Sends a REPORT SELF-CONFIGURATION STATUS request to find out the contents of the "last self-configuration status descriptor index" field in the response. If it is different from SDI then it re-issues that request with the "starting self-configuration status descriptor index" field set to the "last" value. Often only the last (i.e. most recent) recorded descriptor is of interest and that is what this option should show. In cases there may be more than one descriptor starting at the last index. -o, --one If multiple self-configuration status descriptors are found, then only output the first one. -r, --raw send the response (less the CRC field) to stdout in binary. All error messages are sent to stderr. -s, --sa=SAS_ADDR specifies the SAS address of the SMP target device. The mpt interface needs this option and it will typically be an expander's SAS address. The SAS_ADDR is in decimal but most SAS addresses are shown in hexadecimal. To give a number in hexadecimal either prefix it with '0x' or put a trailing 'h' on it. -v, --verbose increase the verbosity of the output. Can be used multiple times. -V, --version print the version string and then exit. NOTES
The "last self-configuration status descriptor index" field in the response may indicate the lowest index of the last recorded (i.e. most recent) "clump" of status descriptors placed in the expander's storage. This utility flags the "last self-configuration status descriptor index" descriptor in its output with a ">>>" indication. For brief output the descriptor line starts with ">>>" while for normal output (i.e. when --brief not given) the index has ">>>" placed in front of it. CONFORMING TO
The SMP REPORT SELF-CONFIGURATION STATUS function was introduced in SAS-2 . AUTHORS
Written by Douglas Gilbert. REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2011 Douglas Gilbert This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
smp_utils, smp_rep_general, smp_discover, smp_discover_list(smp_utils) smp_utils-0.96 May 2011 SMP_REP_SELF_CONF_STAT(8)
All times are GMT -4. The time now is 03:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy