10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Foe example we have three environments int,qa and prod.Each environment has some number of servers.
int=Server1,Server2,Server3
qa=Server4,Server5,Server6
prod=Server7,Server8,Server9
echo "Enter the Environment i.e int,qa,prod"
read env
case $env in
int)
## Need command where all the... (9 Replies)
Discussion started by: nareshreddy443
9 Replies
2. Shell Programming and Scripting
Hi. I wrote the following case statement to replace a series of 'ELIF' statements as it looks better and is easier to maintain. However, for some reason the commands don't fully work in this format. Take option 1. It should call a script that runs in the background but it doesn't work. Can anyone... (3 Replies)
Discussion started by: user052009
3 Replies
3. Shell Programming and Scripting
have written the below code to check whether the string received from user is a file name or dir using case statement, but its going into default case*).
#!/bin/sh
#Get a string from user and check whether its a existing filename or not
rm str2
rm str3
echo "enter a file \c"
read fil... (8 Replies)
Discussion started by: Mohan0509
8 Replies
4. Shell Programming and Scripting
hi all
i am trying to get help with writing a script using case statement to display menu as
1) Authentication log
2) System log
3) Messages
4) Dmesg
5) Boot log
Q) Exit
When selecting the menu by 1 or 2 or 3 o 4 or 5, it should display the last 10 lines of the log files,
if... (3 Replies)
Discussion started by: renegade11
3 Replies
5. Shell Programming and Scripting
I am using a variable called $variable in a pattern search to print from a starting variable to a constant value. the variable search should be case in sensitive.
i tired using Ip at the end in the below command. but in ksh it is not working.
sed -n "/$variable/,/constant/p" file
i also... (11 Replies)
Discussion started by: johnjs
11 Replies
6. 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
7. 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
8. Shell Programming and Scripting
Hi,
I'm really new ro shell scripting (actually any kind of programming) and am pretty sure I'm making a pretty basic error here but I can't for the life of me figure it out.
What I'm trying to do is get an array working with a case statement in a KSH script. The code is as follows:
... (3 Replies)
Discussion started by: SReilly
3 Replies
9. Shell Programming and Scripting
Hi
I have the following case statement:
case $larg in
*_* )
a=${larg%_*}; b=${larg#*_};
;;
*^* )
a=${larg%^*}; b=${larg#*^};
;;
esac
I cannot figure out what *_* and *^* stand for...
Also what a=${larg%_*}; b=${larg#*_}; and
a=${larg%^*}; b=${larg#*^}; ... (1 Reply)
Discussion started by: aoussenko
1 Replies
10. Shell Programming and Scripting
I am trying to write a ksh script using the case statement to select certain directories to remove. The directories that I am looking for are in the following format 2008-10-10. I want to exclude all other files/directories that contain anything other the 4 digit year,a dash, 2 digit month, a... (2 Replies)
Discussion started by: dgilc
2 Replies