Sponsored Content
Top Forums Shell Programming and Scripting Validating inputs from a file Post 302073097 by vino on Wednesday 10th of May 2006 05:49:07 AM
Old 05-10-2006
man test. Look for -z.

Code:
#! /bin/ksh

echo "ab bc cd" | while read a b c d
do
[ -z "$a" ] && echo "empty a" || echo "$a"
[ -z "$b" ] && echo "empty b" || echo "$b"
[ -z "$c" ] && echo "empty c" || echo "$c"
[ -z "$d" ] && echo "empty d" || echo "$d"
done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading in two inputs from a file

Hi all, I've been assigned the task of modifying a script which reads in names of tables from a list file, exports a 30 days worth of data from these tables, then deletes the table. The list file will now contain a table name and a number next to it indicating how many days to archive. I need... (1 Reply)
Discussion started by: MadHatter
1 Replies

2. Shell Programming and Scripting

Inputs from a file

Hi, I have a shell script that has to taken inputs from a file say "Inputs". Now I take 2 inputs at a time. Suppose the Inputs file contains numbers like 2 3 4 5 Now I have a written a script for adding 2 numbers. When I run the script for first time 2 and 3 must be the inputs. When i run the... (4 Replies)
Discussion started by: sendhil
4 Replies

3. Shell Programming and Scripting

validating a file or directory

Hi there, im writing a script and trying the get the 2nd parameter and check it if its valid file or valid directory, Example: ./test -a quiz1 i need to check quiz1 ($2) if it matches any name of a file or directory. Thanks (3 Replies)
Discussion started by: new2Linux
3 Replies

4. Shell Programming and Scripting

How to read inputs from a file

Hello; Please I need to read inputs from a file change 1 or 2 things the output to another file. (1 Reply)
Discussion started by: jimoney
1 Replies

5. Shell Programming and Scripting

validating a file based on conditions

i have a file in unix in which the records are like this aaa 123 233 aaa 234 222 aaa 242 222 bbb 122 111 bbb 122 123 ccc 124 222 In the output i want only the below records aaa ccc The validation logic is 1st column and 2nd column need to be considered if both columns values are... (8 Replies)
Discussion started by: trichyselva
8 Replies

6. UNIX for Dummies Questions & Answers

Validating a file

Pardon my ignorance but I am lost on how to do this I have a file called "Sample.txt", it is pipe delimited, it should have 13 fields. But some of the records do not, I would like to set up a shell script where I can pass in a parameter "Sample.txt" and it would split the file into records... (2 Replies)
Discussion started by: dgeehot
2 Replies

7. Shell Programming and Scripting

Validating the file

Hello All, I have the following file. The first column is Type. Always the file will have one H and one T type in between all D type reocrds. Need todo some validations. H|ABCD D|TAB N0003107809CD2013-11-14|RYAN|FRY|7 DR|RICHMOND HILL|GA|32431|X|C95|000009999|000000001|TAB||C0001 D|TAB... (3 Replies)
Discussion started by: karumudi7
3 Replies

8. Shell Programming and Scripting

Csv file parsing and validating

Hi, I have basic knowledge on unix shell scripting(not an expert). My requirement is reading the csv file using the schema defined in the configuration file and if the condition is not mached then move the unmatched record to a error file and matched good records into other file. In brief: ... (43 Replies)
Discussion started by: shree11
43 Replies

9. Shell Programming and Scripting

Validating a file in ksh

Ladies and Gents, I need to be able to verify the file and validate the file format. Is there a way to verify this using ksh? Please forgive me, I'm very new to UNIX scripting. 12345_dbname_1_sqlname.sql 12345 - change number dbname - database name 1 - sequence sqlname - sql... (4 Replies)
Discussion started by: Philani
4 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 07:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy