9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a sample server name listed in variable as below:
var="server-13"
I need to check if the 7th character on $var is number 1
whichenv=`echo "$var"| head -c 7 | tail -c 1`
if ]; then
echo "9 found"
else
echo "9 Not Found"
fi
Output:
This works... (3 Replies)
Discussion started by: mohtashims
3 Replies
2. Shell Programming and Scripting
HI
cd ${back_home}
if above back_home does not exist, then script shoul exit. Please let us know how to do that (7 Replies)
Discussion started by: buzzme
7 Replies
3. Shell Programming and Scripting
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
4. Shell Programming and Scripting
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies
5. HP-UX
Executed the following if conditions .. and got different results .
only (( )) gave correct o/p with all scenarios .
Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition.
And why each condition gave different result.
1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies
6. Shell Programming and Scripting
After my if condtion give rusult true then script should stop execution.
Please advice...Thnaks in advance (1 Reply)
Discussion started by: vivek1489
1 Replies
7. Linux
Hello all,
I have a question, and would like some advice please. I am a windows guy by trade....5 years in the Marines is where I learnt a lot of what i know. I took a junior level sys admin job...learned a bit more...and now I do IT security. All of this happened in the last 8 years. So I'm 27... (2 Replies)
Discussion started by: Quality
2 Replies
8. UNIX for Dummies Questions & Answers
I am new to UNIX and Linux. I have some experiences with Windows server. I am thinking to start with those OS (Unix/Linux) and more specifically with the OS for the server. however, i have no idea which one would i start first, unix or linux? Because i also dont know how they are different.
... (3 Replies)
Discussion started by: sanlen
3 Replies
9. UNIX for Dummies Questions & Answers
I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days...
The structure of the paths are like this:
/home/domains/www.domain2.com/tgp/
/home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies