10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
i have to test a condition for n times and if its value is greater than one each time for continuous 5 iterations it will take action
My Approach
run the same command 5 times in for loop and divert the output to a file and then read the values from file and use if else if and take action
... (1 Reply)
Discussion started by: abhaydas
1 Replies
2. Shell Programming and Scripting
hi.,
As we know that using for-loop or while condition, we can only process one by one sequentially, but , lets say this example :
1. under the folder "logs" there are 1000 files
2. each file has one record or line
3. have to perform atleast 7 queries per 3 seconds ,for instance
... (3 Replies)
Discussion started by: alnhk
3 Replies
3. UNIX for Dummies Questions & Answers
Without grep, I'd like to make a test condition so that any a word that does not have the successive letters car in it will be echoed. for example, bluecar will contain "car" so it will show up as a no
var=bluecar
$ echo $var|if ]; then echo "yes";fi
yes
this variable contains "car" so I... (5 Replies)
Discussion started by: newbie2010
5 Replies
4. Shell Programming and Scripting
How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies
5. Shell Programming and Scripting
Hi there,
I tried to search for this almost everywhere, but didnt get any proper information on it.
What is the difference between
]
Some of the code works when I have only single condition i.e.
] && $dothis1 || $dothis2
But if i try to include another testcondition to the... (1 Reply)
Discussion started by: tostay2003
1 Replies
6. Shell Programming and Scripting
Hello,
what is the better and correct way to perform a comparison:
I have been using the following with no problems:
if ]
then ....
fi
I have seen this also used :
if
then ....
fi
When I try :
if
then ....
fi
I get an error like .... the test condition expects a... (4 Replies)
Discussion started by: gio001
4 Replies
7. Shell Programming and Scripting
Hi i found the following code in a date calculation script.
if ((!(year%100))); then
((!(year%400))) && leap=1
else
((!(year%4))) && leap=1
fi
I have not find such an use of if statement till now.
As for my knowledge this is the syntax of if statement
if
then
... (1 Reply)
Discussion started by: ravi raj kumar
1 Replies
8. UNIX for Dummies Questions & Answers
Hi there,
When I try to do a condition on test:
$ str1=abcd
$ test $str1
$ echo $?
0
Is there anyway to display the answer to be 'TRUE' or 'YES'? rather than 0?
If so, how can I do it without using awk or sed. (2 Replies)
Discussion started by: felixwhoals
2 Replies
9. Shell Programming and Scripting
Guys look at this:
i have to write a script that takes a file as an argument. The script should be able to determine what permissions the owner, group and everybody has for the file passed in. The output should be displayed similar to this.
READ WRITE EXECUTE
OWNER LEE.BALLANCORE YES YES NO... (9 Replies)
Discussion started by: ciroredz
9 Replies
10. Shell Programming and Scripting
I'm new to scripting and I need help with a bourn shell script. What i'm trying to do is a test condition where "if the time is within 2 hours, it's true" and so on.
The time is in the following format
DATE=`/bin/date +"%Y%m%d%H%S"`
for example, 20060907152000.
So, what the script first... (9 Replies)
Discussion started by: pieman8080
9 Replies