Hi
How do i compare two strings in shell script. Below is an example but I am not getting the desired output, plz help
if
then
echo success
fi
I am not getting the desired output if I do this. plz help (24 Replies)
Hi All,
While I am trying to run below code I Am getting the exception like
./abs.sh: line 102: syntax error near unexpected token `then'
./abs.sh: line 102: ` then'
The Code Snippet is:
if then
cat $file1 | sed -e... (8 Replies)
i have a string in a file which gets repeated number of times like below:
rpttxt("abc")
.
.
rpttxt("REP_TITLE")
rpttxt("BOS_TITLE")
.
.
.
.
and so on
using awk or grep how can i comapre the string( as the second half keeps varying) and store it in a temporary variable? I am using the... (3 Replies)
hi All
i am facing prob in comparing two strings that have two word.
below is the code snippet.
checkValidates="file validates"
file3_name="file"
if
then
echo "file" $file3_name "is validated successfully"
fi
when i run this i get the error as -bash: [: too many arguments
... (1 Reply)
Hello All
Please I have got a file called DATE.tex which consist of
01-04-2008_12:00:00
01-04-2005_12:00:00
01-04-2003_12:00:00
01-04-2007_12:00:00
01-04-2002_12:00:00
01-04-2009_12:00:00
I want to use nawk to print out the dates >=01-04-2009_12:00:00
I tried this
cat plnt.new |... (6 Replies)
Hey guys how do I compare 2 strings from the text file,
and check for duplication?
For example, I add an item call Laptop, it will record to the textfile call file.
If it detects duplicate it will say the record record exist?
file.txt contains
Laptop:Sony:1000
Phone:Apple:30
A head... (4 Replies)
Hi I tried the following string comparison script in Ksh88
#!/bin/ksh
str1='aC'
str2='ABC'
if
then
echo "Equal"
else
echo "Not Equal"
fi
Though str1 and str2 are not equal the script output says Equal .
Please correct me
Thanks (2 Replies)