Search Results

Search: Posts Made By: harsha85
1,746
Posted By methyl
Bad post. This will cause the script to crash if...
Bad post. This will cause the script to crash if presented with a valid parameter like "Bangalore" because it will try to execute a program called "Bangalore".
Try it.


Stick to test. It's a...
1,746
Posted By Franklin52
This is Useless Use of Cat...
This is Useless Use of Cat (http://partmaps.org/era/unix/award.html), this is sufficient:
result=`grep $1 file.txt`
5,522
Posted By jim mcnamara
change if [ $result -eq $1 ] to if [ "$result"...
change if [ $result -eq $1 ]
to if [ "$result" = "$1" ]

-eq only works for integers, and you can pass ant string as $1, You may also want to change your grep to grep -F "$1". This -F lets you...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 02:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy