10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm having an issue with bash read input when using a case statement.
The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected. Need some help here.
defaultans=8hrs
read -e -i $defaultans -p "${bldwht}How long would you like... (5 Replies)
Discussion started by: woodson2
5 Replies
2. Shell Programming and Scripting
Below is what i have in my script.
htcount=$(curl -s --user tomcatstatus:tomcatstatus http://`hostname`.mypc.com:887/manager/jmxproxy?qry=Catalina:type=ThreadPool,name=\"http-nio-887\" |grep sBusy | cut -d ' ' -f2)
echo $htcount
if ; then
echo "more than 10"
else
echo "Less than 10"
fi... (6 Replies)
Discussion started by: mohtashims
6 Replies
3. Shell Programming and Scripting
Using BASH:
$ if -- ::00" ]]; then echo "true"; else echo "false"; fi
false
Mike (5 Replies)
Discussion started by: Michael Stora
5 Replies
4. Shell Programming and Scripting
Hello,
The standard case statement :-
case "$1" in
"IE0263")
commands;;
"IE0264")
commands;;
esac
is it possible to have :-
case "$1" in
"IE0263" OR "IE0878")
commands;;
"IE0264")
commands;;
esac
Thanks (4 Replies)
Discussion started by: jmahal
4 Replies
5. Shell Programming and Scripting
I am trying to get folder names that contain only numbers.
Can someone explain why following command is printing 'total 450' as part of output..
$> ls -lt | awk '$9 ~ /^*$/' | more
total 450
drwxr-x--x 3 user1 group1 512 Mar 9 2008 329227163
drwxr-x--x 3 user1 group1 ... (17 Replies)
Discussion started by: kchinnam
17 Replies
6. Shell Programming and Scripting
total=0
seq 1 5 | while read i ; do
total=$(($total+$i))
echo $total
done
echo $totalThis outputs:
1
3
6
10
15
0whereas I am expecting:
1
3
6
10
15
15My bash version: (4 Replies)
Discussion started by: meharo
4 Replies
7. Shell Programming and Scripting
Hi,
I am writing case statement to execute some finction, my requirement is once one of the case statement is executed again it has to prompt for the option.
for script in `echo "$Script_Selected"`
do
case $script in
1) getNoOFActUsers
;;
2) moveServerrOORotation
;;
... (2 Replies)
Discussion started by: Satyak
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am writing a bash shell script. My script has a few user defined parameters. When the script runs the first thing it does is make sure that these parameters are valid. One of the parameters is called YEAR. A valid input for YEAR can be 1997-2000.
One way I have come up with to ensure... (3 Replies)
Discussion started by: msb65
3 Replies
9. Shell Programming and Scripting
Hello.
Consider the following magic words:
# ls `which adduser`
ls: /usr/sbin/adduser: No such file or directory
#
Hmmm...
Then:
# ls /usr/sbin/adduser
/usr/sbin/adduser
#
Now what?
Unforunately this little sniippet is used in my debian woody server's mysql pre install script.... (2 Replies)
Discussion started by: osee
2 Replies
10. Shell Programming and Scripting
Hi all,
is it possible to create a 'dynamic' case statement.
ie
select option in `ls`
do
case satement depending on results of the above `ls`
done
I hope I have explained this ok!
Thanks
Helen (1 Reply)
Discussion started by: Bab00shka
1 Replies