10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue.
#!/bin/bash
PLATFORM="AIX"
NEEDSPC=3000
set -x
if ; then
lsvg | grep -v rootvg | while... (6 Replies)
Discussion started by: port43
6 Replies
2. Shell Programming and Scripting
Hello, can you please help me because I am totally confused with a simple script:
#!/bin/bash
] || ] && echo "Good Morning"
] || ] && echo "Good Night"
For me, these two strings are indentical: false || false and there is no point to execute echo command.
But the run result is... (5 Replies)
Discussion started by: AndreiM
5 Replies
3. Shell Programming and Scripting
Hello All,
Alright, so this is driving me absolutely insane. I can't seem to find this ANYWHERE...
I've tried every combination and synonym I can think of for this trying to search Google.
What is the Expect/Tcl equivalent to Perl and Bash's "=~" operator, (i.e. the "contains" operator).... (2 Replies)
Discussion started by: mrm5102
2 Replies
4. Shell Programming and Scripting
Hello,
I am not sure, where I am missing in the scirpt, I am trying to grep few users from /etc/passwd file and if exists, I added line to echo as user exist, if not create it.
#!/bin/bash
for vid in v707 z307 z496 z163 z292 ; do
if
then
echo " $vid User exists "
else
... (2 Replies)
Discussion started by: bobby320
2 Replies
5. UNIX for Dummies Questions & Answers
Hello All,
I am trying to do a simple calculation using modulus (%) as shown below. But some how it is not showing me correct result. It says "0.166667" is equal to "0" which is wrong. Could you please help me how can i make it work. Thanks a lot.
#!/bin/ksh
attempt_count=10
SLEEP=60... (7 Replies)
Discussion started by: Ariean
7 Replies
6. Shell Programming and Scripting
Hi,
I have a variable, $sername, and I would like to display this variable only if it *does not* contain either of these two tags: *DTI*FA* or *DIFF*FA*.
I think the syntax for my 'or' operator is off. The variable $sername is continuously changing in an outer loop (not shown), but at the... (4 Replies)
Discussion started by: goodbenito
4 Replies
7. Shell Programming and Scripting
I am sure there should exist a chomp like Perl operator in Bash using which I can literally remove new line characters as show below:
Any clue? (3 Replies)
Discussion started by: paragkalra
3 Replies
8. Shell Programming and Scripting
I need to read the file divide 3 column with 2nd and run a modulus of 10 and check whether the remainder is zero or not if not print the entire line.
cat filename | awk '{ if ($3 / $2 % 10 != 0) print $0}'
Whats wrong with it ? (4 Replies)
Discussion started by: dinjo_jo
4 Replies
9. Shell Programming and Scripting
I'm almost pulling out my hair trying to figure out what's wrong with this... there's no reason I can see that it shouldn't be working. It seems that the code acts as though the conditional statement is true no matter what - I've even tried removing the negation operator, but it always goes into... (5 Replies)
Discussion started by: wildbluefaerie
5 Replies
10. Shell Programming and Scripting
What is the modulus operator in korn shell?? (5 Replies)
Discussion started by: manash.paul
5 Replies