I want to do the following validations in my script when my script gets 2 parameters as command line inputs.
My script expects 2 inputs : a -f option and a filename
If a filename is given as input without the -f option then I have to exit. If only -f option is given and no filename is given then also I have to exit.
Once I get both the inputs I have to check whether the file has read permissions or not.
Please provide me a snippet of code as of how to do this.
Thanks in advance
If the filename is all that you need, why have a -f flag ? It is not needed unless you have other flags, or plan to introduce other flags.
Hi,
I have a script called read.sh that takes a file as input. Now I want to make that script take the file as input with a -f option preceding the filename. How can I do this validation. How can I find whether the given option is -f or not inside the script.
Thanks in advance (2 Replies)
Hello Everybody,
I have a file with data like this
8z:1
15y:0
7x:0
12w:1
...
...
I would like read each line through a loop and will needing to get the input from each line like this
For 8z:1; a=8,b=1
15y:0; a=15,b=0
7x:0; a=7,b=0
Please let me know of a way to... (5 Replies)
Hi ,
I am not able figure out how to use expect tool to send input to this prompt of format
Searching for disks...done
selecting c0t3d0
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition... (3 Replies)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Hi all,
I have a script which should take more than 9 command line inputs while running. Likescript.sh a s d f g h j j k l o p i u y t r e w
Now in the script if I have to access one of the input which is at position after 9, in this case say 'p' then how can I do that?
echo $12 will not work... (15 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Hi there,
I'm trying to create a script that will accept multiple inputs by copying and pasting the strings from a notepad, hit Enter key and output the string to a text file.I'm thinking of using the read command however it will just simply get the first line.
Apologies but got no idea how... (7 Replies)
I am looking for help in processing of those options: '-n' or '-p'
I understand what they do and how to use them.
But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.)
I did try it and -n works on 2 files.
Question is:
- is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies
LEARN ABOUT NETBSD
mixerctl
MIXERCTL(1) BSD General Commands Manual MIXERCTL(1)NAME
mixerctl -- control audio mixing
SYNOPSIS
mixerctl [-d file] [-n] [-v] -a
mixerctl [-d file] [-n] [-v] name ...
mixerctl [-d file] [-n] -w name=value ...
mixerctl [-d file] [-n] -w name++ ...
mixerctl [-d file] [-n] -w name-- ...
mixerctl [-d file] [-n] -w name+=value ...
mixerctl [-d file] [-n] -w name-=value ...
DESCRIPTION
The mixerctl command displays or sets various audio system mixing variables. If a list of variables is present on the command line, then
mixerctl prints the current value of those variables for the specified device. If the -a flag is specified, all variables for the device are
printed. If the -w flag is specified, mixerctl attempts to set the specified variables to the given values.
The -d flag can be used to give an alternative mixer device. The default is /dev/mixer.
The -n flag suppresses printing of the variable name.
The -v flag shows the possible values of enumeration and set valued variables. Enumerated values are shown in brackets (``[]'') and set val-
ues are shown in curly braces (``{}'').
The exact set of controls that can be manipulated depends on the mixer. The general format (in both getting and setting a value) is
class.name = value
class can have values like inputs or outputs, indicating that the control affects the input or output of the mixer, respectively. name indi-
cates what part of the mixer the control affects. Continuous mixer values, e.g., volume, have numeric values in the range 0-255. If value
can be set for each channel independently, the values are printed separated by commas. Discrete mixer values, e.g., the recording source,
have symbolic names. Depending on the mixer it may either be an enumeration or a set.
The suffixes ++ and -- can be used to step through the values of a mixer control. For numeric controls, these operators increase or
decrease, respectively, the value by an amount (the delta) suitable to make the control assume the next possible value. For binary controls,
these operators toggle between on and off.
The operators += and -= change the value of a mixer control by the indicated number of steps.
ENVIRONMENT
MIXERDEVICE the mixer device to use.
FILES
/dev/mixer mixer audio device
/etc/mixerctl.conf mixer configuration file
EXAMPLES
The command
mixerctl -a -v
can produce
inputs.mic=0,0 volume
inputs.mic.mute=off [ off on ]
inputs.cd=220,220 volume
inputs.cd.mute=off [ off on ]
inputs.dac=220,220 volume
inputs.dac.mute=off [ off on ]
record.record=220,220 volume
record.record.source=mic [ mic cd dac ]
monitor.monitor=0 volume
COMPATIBILITY
The old -f flag is still supported. This support will be removed eventually.
SEE ALSO audioctl(1), audio(4), mixerctl.conf(5), sysctl(8)HISTORY
The mixerctl command first appeared in NetBSD 1.3.
BSD August 15, 2008 BSD