10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, So I got his code below. $year is a string of 2010,2011 etc.
I guess I want to convert $year to an integer so I can do my if statement to see if the year string is greater than 2010? Or how could I do this?
Right now I get a syntax error doing this.
fi (2 Replies)
Discussion started by: vsekvsek
2. UNIX for Dummies Questions & Answers
Hello I'm very new to Linux and shell scripting so I only know basic stuff. I'm making a script with the purpose of finding the longest string or word in a file. Here's what I got so far:
for i in $(strings -n $1); do
echo $longest... (4 Replies)
Discussion started by: SCB
3. Shell Programming and Scripting
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?
A head... (4 Replies)
Discussion started by: aLHaNz
4. Shell Programming and Scripting
What would be the sed command to do this? (7 Replies)
Discussion started by: cola
5. Shell Programming and Scripting
i am facing prob in comparing two strings that have two word.
below is the code snippet.
echo "file" $file3_name "is validated successfully"
when i run this i get the error as -bash: [: too many arguments
... (1 Reply)
Discussion started by: infyanurag
6. Shell Programming and Scripting
i have 2 strings. i want to compare the strings.
please help (2 Replies)
Discussion started by: satish@123
7. Shell Programming and Scripting
i have a string in a file which gets repeated number of times like below:
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)
Discussion started by: agarwal
8. Shell Programming and Scripting
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:
cat $file1 | sed -e... (8 Replies)
Discussion started by: Anji
9. UNIX for Advanced & Expert Users
I have two strings
how can I compare them
Is this fine
if then (2 Replies)
Discussion started by: yakyaj
10. Shell Programming and Scripting
How do i compare two strings in shell script. Below is an example but I am not getting the desired output, plz help
I am not getting the desired output if I do this. plz help (24 Replies)
Discussion started by: ragha81