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
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
3. Shell Programming and Scripting
i want to get user input like this
please tell which option to chose
1. mango 2. tango 3. rango
if user chooses mango
then it should execute a set of statements and again ask like this
what do you want to do
1.add 2.subtract 3.exit
when i choose exit it should goto my previous menu... (4 Replies)
Discussion started by: s.deepak
4 Replies
4. Shell Programming and Scripting
i want to get user input like this
please tell which option to chose
1. mango 2. tango 3. rango
if user chooses mango
then it should execute a set of statements and again ask like this
what do you want to do
1.add 2.subtract 3.exit
when i choose exit it should goto my previous... (1 Reply)
Discussion started by: s.deepak
1 Replies
5. 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
6. 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
7. 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
8. UNIX for Dummies Questions & Answers
Hi,
I need to redirect the debug statements to out.txt
{(set -x) >> out.txt} ??? (1 Reply)
Discussion started by: redlotus72
1 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