10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to check (using bash condition test function) if string contains three spaces, ignoring last three spaces at the end of string.
string_to_report='foo bar foo bar '
string_to_ignore='foo bar ' (8 Replies)
Discussion started by: useretail
8 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
Hi,
I have the following script under bash
if ; then
echo File $file_name Not Found
else
echo File $file_name Found
fi
I get the message
even the file is found; there is only one file with that name in the directory
I can't figure... (4 Replies)
Discussion started by: f_o_555
4 Replies
4. UNIX for Advanced & Expert Users
Hi,
I am unable to run a selective set of tests in gcc-4.5.1 test suite.
I tried two runtest commands given below (output is also given below).
Can you please guide me how to run specific set of tests for example :
I would like to run only tests gcc.target/i386/avx-vaddpd-1.c and ... (0 Replies)
Discussion started by: ganesh2282
0 Replies
5. Shell Programming and Scripting
Hello,
We have to configure servers with a range of IPs which is in itself a subject for another script assistance request -but- we have run into quite a few IP ranges with routing problems lately.
I've been trying to figure out the best way to test a range of IPs, I mean, manually it's not... (4 Replies)
Discussion started by: boxgoboom
4 Replies
6. Shell Programming and Scripting
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Discussion started by: Max89
1 Replies
7. Shell Programming and Scripting
I want to test if my host can connect to any of the following 10 hosts (192.168.1.0 to 192.168.1.9)
I didnt know which command i should use, so i chose ping. (i wonder if i should use tracepath or sth else)
my code is the following:
#!/bin/bash
clear
firstPart="192.168.1"
maxNum="9"
... (2 Replies)
Discussion started by: shadow_boi
2 Replies
8. 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
9. Shell Programming and Scripting
Hello all,
I would like some help to find the regexp to test that a word does not contains anything than the character set of printable strings.
Especially the word should not contain a underscore.
echo "$word" | grep "( \'\(\)+,-\.:=\?)+"
if
then
echo success
else
echo failed... (2 Replies)
Discussion started by: dolphin06
2 Replies
10. Shell Programming and Scripting
Hi
I want to do a regex test and branch based on the test result, but this doesn't seems to work :confused:
if \) ]]
then
echo success
else
echo failed
fi (1 Reply)
Discussion started by: subin_bala
1 Replies