The standard way of doing this (when exactly one of two possible options or operands are required) is to use a two line synopsis:
See the cp man page for an example.
The notation:
indicates that the only way to use create_sql is to pipe its output to the --pto-list command.
The notation:
indicates that --pto can be specified or --pto-list can be specified, but not both; and neither one is required.
In all of these usage statements you're saying that -f is a mandatory option that requires a filename option-arument, -a is a mandatory option that requires an add client option-argument, --pto and --pto-list are long options that do not take an option-argument, you have a required filename operand and you have another long-option (--sim) that violates standard Utiiity Syntax Guideline #9 (all options are supposed to appear on the command line before operands). The order in which the -a, -f, --pto, --pto-list, and --sim options appear on the command line does not matter when you invoke the command, but all options should appear before any operands. The standards don't acknowledge the existence of long options either, but they are a common extension that falls into an area that the standards allow but do not require (a condition in the standards known as unspecified behavior).
By convention, if a long option takes an option-argument, that should be shown in a synopsis as --option=argument; not as --option argument to preclude an ambiguity issue with long option optional option-arguments. (Having short option optional option-arguments violates Utiiity Syntax Guideline #7.)
These 4 Users Gave Thanks to Don Cragun For This Post:
I'm stuck on a particular problem and need some guidance. I have a file with a name and a phone number in it (teledir.txt). I need to do a $# in a separate script to take a positional parameter and check to see if it is in the file. To quote the question:
If one argument is supplied, check... (6 Replies)
Hi,
Am working in a filenet domain where we are using AIX as our terminal to run the jobs and schedule the shell scripts to run . In my previous post regarding the "Log modification with finding errors" ... (12 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
I am writing a script in bash and want to perform the operation
I check number of arguments and make a print statement with the passes arguments
If I pass 3 arguments I will do
printf "$frmt" "$1" "$2" "$3"If I have 4 arguments I do
printf "$frmt" "$1" "$2" "$3" "$4"etc (4 Replies)
Hello friends,
I have a boubt passing different arguments at a time for any one option in below code.
I would also like to check which option has been selected (any one of i, r, u ) so that whether or not matching argument passed can be verified.
for i and r - install and re-install -... (4 Replies)
I have an awk script which can be used in the following ways:
xi and xf will only be mandatory when processing the file fin.zc.
awk -v xi=0/-0.5 -v xf=80/30 -f ./zc2cmd.awk fin.zc > fout.cmod
awk -f ./zc2cmd.awk -u
awk -f ./zc2cmd.awk --usg
awk -f ./zc2cmd.awk -e
awk -f ./zc2cmd.awk... (1 Reply)
Hi,
I need to carry out the back up of the data if exists...(file size not equal to zero)
i tried in this way but it is not successful....where am making the mistakes? and if possible can i use case syntax in place of "if"
#!/bin/ksh
filename=`TZ=CST+24 date +%Y%m%d`
ZERO=0... (3 Replies)
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)
I am new to shell, and I am trying to do a if statement like the following:
if ; then
basically it works fine if both arguments of the if are met, however the next elif is:
elif ; then
if the conditions of the elif are met, then it says "final1.sh: line 67: [: too many arguments"
... (6 Replies)