There need to be space around the single brackets ( and also a single = sign ) and no space after the $-sign and best to have quotes around the variables...
Of course the asterisks need to go as well.
This User Gave Thanks to Scrutinizer For This Post:
If the problem is really only that... try replacing ==with -eq == is for string comparison, -eq for arithmetic test
When comparing decimal numeric strings for equality, the results from:
will always be identical as long as there aren't any "leading" zeros at the start of the string or after an initial minus sign
But when one of the two numbers can be an empty string (as in the example given by the OP), the first test will indicate that the two strings are not equal; but the second test will give you a syntax error in some shells (such as bash) because an empty string is not a numeric value. Other shells (such as ksh) will compare them as if the empty string is zero when using -eq.
Some shells accept == as a synonym for = as a test operator, but correctly writen applications will use =, not == in this form of test.
This User Gave Thanks to Don Cragun For This Post:
Hi all,
I have written the following program and run on both T5440 and T5220 on same OS version. I found that T5540 server takes more time than T5220. Please find below the details.
test1.cpp
#include <iostream>
#include <pthread.h>
using namespace std;
#define NUM_OF_THREADS 20... (17 Replies)
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Hi
I have written a script .The script runs properly if i write sql queries .But if i use PLSQL commands of BEGIN if end if , end ,then on running the script the comamds are getting printed on the prompt .
Ex :temp.sql
After connecting to the databse at the sql prompt i type... (1 Reply)
Hi,
I want to add \n as a EOF at the end of file if it does't exist in a single command. How to do this?
when I use command
echo "1\n" > a.txt
and
od -c a.txt
0000000 1 \n \n
0000003
How does it differentiate \n and eof in this case?
Regards,
Venkat (1 Reply)
Hi,
I would like to learn shell scripting in UNIX. Can any one please give me the support and share the information/documents with me.
If any documents please post it to aswanikumar_nimmagadda@yahoo.co.in
Thanks in advance...!!! (3 Replies)
I am looking for a utility (Windows/Linux/Mac) that will allow me to run some test packets across a customer's network (between their client & my server) to identify a list of (or at least a guess of) all protocols and significant network settings that could adversely effect my systems performance... (1 Reply)
following is the output from traceroute
traceroute 10.1.11.6
traceroute to 10.1.11.6 (10.1.11.6), 30 hops max, 38 byte packets
1 10.129.1.250 (10.129.1.250) 20.618 ms 0.335 ms 0.271 ms
2 192.0.20.1 (192.0.20.1) 0.694 ms 4.660 ms 0.422 ms
3 192.0.40.1 (192.0.40.1) 0.972 ms 1.917 ms 0.873 ms... (4 Replies)
I'm trying to compile and install both most recent version of 'make' and the
most recent version of 'openssh' on my Sparc20.
I've run into the following problems... and I don't know what they mean. Can
someone please help me resolve these issues?
I'm using the 'make' version that was... (5 Replies)