10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
May i please know how do i check if the given input argument is one of the listed numbers then success else failure. I am using bash shell.
if
then
echo "success"
else
echo "failure"
fi
Thank you. (2 Replies)
Discussion started by: Ariean
2 Replies
2. Shell Programming and Scripting
Hello,
I would like to control and check the right parameters
$1 must have 4 alphabetics digits among eora qora pora fora
$2 must have 2 numerics digits 00 to 11
$3 must have 2 numerics digits 00 to 59
$4 must have 10 characters alpha numerics as 2013-02-26
For example :
In case 5) if i... (15 Replies)
Discussion started by: amazigh42
15 Replies
3. Shell Programming and Scripting
Hello,
I would like to control and check the right parameters
$1 must have 4 alphabetics digits among eora qora pora fora
$2 must have 2 numerics digits 00 to 11
$3 must have 2 numerics digits 00 to 59
$4 must have 10 characters alpha numerics as 2013-02-26
For example :
In case 5) if i... (1 Reply)
Discussion started by: amazigh42
1 Replies
4. Shell Programming and Scripting
Hey i got trivial question but i cant figure it out. I want to grep a file for multiple unknown parameters. The user will enter these parameters at the command line. For example...
./program red apple filename
This would grep for the phrase red apple. But i cant just do $1 $2 because the... (8 Replies)
Discussion started by: GmGeubt
8 Replies
5. Shell Programming and Scripting
Hey,
I am trying to check if an integer is even in a tcsh script
This is what I am running now
set lattest = ` echo $latmin "%2" | bc -l `
echo $lattest
if ( $lattest == 0 ) then
echo "min is already even"
else if ( $lattest =! 0 ) then
set latmin = ` echo $latmin "+1" |... (2 Replies)
Discussion started by: travish12
2 Replies
6. Shell Programming and Scripting
Hi,
I have a file with data as given
$cat file1.txt
123
234
23e
234.456
234.876e
345.00
I am checking if the values are proper integers using the command.
nawk -F'|' 'int($1)!=$1 {printf "Error in field 1|"$0"\n"}' file1.txt
This is checking for only integers ( without... (10 Replies)
Discussion started by: ashwin3086
10 Replies
7. Shell Programming and Scripting
Hi,
I have one file like 00123. And this file name is generated as a sequence.
So how can I confirm the generated file name is a number, not a special character or alphabets.
Can anybody help me out.
Thanks in advance. (3 Replies)
Discussion started by: Kattoor
3 Replies
8. Shell Programming and Scripting
Hi,,
this is returning true in all cases..( other than 10 dig number also)
what could be wrong?? (2 Replies)
Discussion started by: shellwell
2 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
I ve a script like....
TBL=employee
sql=`cat abhi.sql` \\ abhi.sql contains ------- select a from $TBL
echo $TBL
echo $sql
SQL=`echo $sql`
echo $SQL
now i want SQL as select a from employee
and as select a from $TBL
How can I achieve this?
Help appriciated (3 Replies)
Discussion started by: abzi
3 Replies
10. UNIX for Dummies Questions & Answers
If I have a variable $X, how do I check it is a number?
Many thanks. (2 Replies)
Discussion started by: handak9
2 Replies