10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi I am new to shell scripting, I wanted to make a shell script that has a case statement asking the user to select their city 1)london 2)tokyo 3) etc., I then want the users input to be stored in a variable and echoed out in another script; so for example if the user selects tokyo, tokyo city code... (2 Replies)
Discussion started by: scriptnewbie
2 Replies
2. Shell Programming and Scripting
Task 1:
#!/bin/ksh
if
then
echo "Usage : $0 Signalnumber PID"
exit
fi
case "$1" in
1) echo "Sending SIGHUP signal"
kill -SIGHUP $2
;;
2) echo "Sending SIGINT signal"
kill -SIGINT $2
;;
3) echo "Sending SIGQUIT signal"
kill -SIGQUIT $2 (3 Replies)
Discussion started by: Ramesh M
3 Replies
3. Shell Programming and Scripting
Hey, guys I really need some help with a project.
"Write a shell program that examines the command line arguments, counts and collects the number of options. Basically it has to collect and count the arguments that start with a "-" and the one's that don't start with a -
I know I have to use... (2 Replies)
Discussion started by: sk192010`
2 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 writing a script to pull diskspace information from our servers. Here is the script that I wrote:
#!/bin/ksh
for host in `cat /oper/hosts/esc.misc`
do
ssh -q -o ConnectTimeout=10 operator@$host df -h|grep "/dev/" |egrep '8%|9%|100%' | awk '{print H " " "at " $5 " with " $4 "... (1 Reply)
Discussion started by: rkruck
1 Replies
6. Shell Programming and Scripting
Hi all,
I think i'm asking a sqtupid question here..
i'm using case sttament, what is the syntax or symbol for "or"?
I thought was ||
here a quick sample of my case statment
echo "Would you like to update your detail ?"
read response
case $response in
... (2 Replies)
Discussion started by: c00kie88
2 Replies
7. UNIX for Dummies Questions & Answers
I want to write a program with the following variables:
a=7000
b=24000
c=613.8
The user can enter two words: Vivid or Blue for example. The challenge is that the user might not want to write the words the way they appear. The user can write V or v or vivid or Vivid or write Blue or blue, or B,... (1 Reply)
Discussion started by: Ernst
1 Replies
8. Shell Programming and Scripting
hi all
i'm writing a script and in it i need to prompt the user if the entered value is correct or not ,i wrote the following and its not working ,its executing the script even if i enter Y/N
pls any help is appreciated
echo "\nAre you sure you entered the right Destination Environment? y :... (5 Replies)
Discussion started by: bkan77
5 Replies
9. Shell Programming and Scripting
Can anyone please tell me why this wont work! Thanks so much!
#!/bin/sh
for file
do
case $file in
*.*.*)
echo Cannot have more than 1 dot
exit
;;
*'**'*)
echo Cannot have more than 1 asterisk
exit
;;
*'*'*|?.)
echo this is a target (19 Replies)
Discussion started by: Zeta_Acosta
19 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