Sponsored Content
Full Discussion: validate input
Top Forums Shell Programming and Scripting validate input Post 302284898 by Shahul on Friday 6th of February 2009 12:54:37 PM
Old 02-06-2009
MySQL

Hope this also should work Smilie

#!/bin/ksh

eval input=$@

echo $input |awk '/^\[/ {print}'
if [ $? -eq 0 ]
then
echo $input |awk '/\]$/ {print}'
if [ $? -eq 0 ]
then
echo "good"
else
echo "Please enter the input ending with ]"
fi
else
echo "Please enter the input starting with ["
fi
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

validate input from user for file name

Hello, This may have been addressed already somewhere, however I am looking for the easiest/shortest way to validate a response from a user for a file name. The file name should not have any of the following characters ~`!@#$%^&*()_-+={|\:;"'<,>.?/ Further the response should not have any... (2 Replies)
Discussion started by: jerardfjay
2 Replies

2. Shell Programming and Scripting

How to validate input values

Hi How would i validate value of a variable whether it is number,date or string Thanks in advance Sas (5 Replies)
Discussion started by: SasDutta
5 Replies

3. Shell Programming and Scripting

Need to validate a date input format

Hi all, I have a shell script(K shell) which takes a date as input. i want the input to be in DD-MM-YYYY format. Can i enforce such a format of input string using just one line of code? OR do i need to parse the input date into different components and test them using Case statements... (2 Replies)
Discussion started by: rajugp1
2 Replies

4. Shell Programming and Scripting

Validate and sort input

Hi, This will most likely be a simple answer. Currently I have a situation where my script will be sent various options: -o1 -o2 -oe3@somthing.com Now, if I want to run a certain command based on the option I am sent, I am doing the following. for o in $(echo $options) do if ... (3 Replies)
Discussion started by: stuaz
3 Replies

5. Shell Programming and Scripting

How to validate input parameters?

Hi, I wonder how I can know if the input parameters to the script are numbers or text Thanks (11 Replies)
Discussion started by: Gengis-Kahn
11 Replies

6. Shell Programming and Scripting

Another validate input Question.

I'm writing a bash shell script to 'help' me post to susepaste (I can NEVER remember the time options). Here's the code: #!/bin/bash ########## # # Project : personal script. # Started : Wed Aug 03, 2011 # Author : Habitual # Description : susepaste c-li script with user... (5 Replies)
Discussion started by: Habitual
5 Replies

7. Shell Programming and Scripting

Epic - Validate input size

Is there an easy way to validate an input field size. Let us say a script is asking to enter 10 digits mobile number, how do I write a script to validate it is numeric and is 10 digits in length? I just need an easy way w/o using looks ...etc. Is there such a away ? Here is what I have so far... (6 Replies)
Discussion started by: mrn6430
6 Replies

8. Shell Programming and Scripting

How to validate user's input..?

$Input_filename=$ARGV; if (!-d $Input_filename && ! -e $Input_filename) { print "USAGE: Please enter '$ABCD/def/dsed.txt' as an arguement \n"; exit; } 1. Input Is suppose to be something like "$ABCD/def/dsed.txt". if the input is wrong the script should throw an ERROR message.... (2 Replies)
Discussion started by: Rashid Khan
2 Replies

9. Shell Programming and Scripting

Validate input files and update

We have a job which we need to run on daily bases, before loading data in a table we need to validate whether the input file is received or not.Inputfile formatsrc_sps_d_Call_Center_Reporting_yyyymmdd_01.dat SPS-Service nameYYYY-yearMM-MonthDD-dayLike above we will get n number of files for... (1 Reply)
Discussion started by: katakamvivek
1 Replies

10. Shell Programming and Scripting

Validate input files daily

We have a job which we need to run on daily bases, before loading data in a table we need to validate whether the input file is received or not. Daily client will place the files in a particular path.Below files which I need to process for 04/01/2013(Load date).... (2 Replies)
Discussion started by: katakamvivek
2 Replies
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
All times are GMT -4. The time now is 10:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy