10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello!
Below my first bash script. As you can see i build 2 nested cases. The second one (sync databases) is working fine. Bu the first one (sync datadirs) is not working. It says: rsync: command not found. However when i move the rsync command to the top of the script its working. So i suppose... (2 Replies)
Discussion started by: hyperconnected
2 Replies
2. 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
3. Shell Programming and Scripting
please let me know if the below code could be written efficiently inside single awk
case "$INP" in
ksh)
cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}'
;;
pset)
cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}'
;;
dml)
cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
Discussion started by: cvsanthosh
2 Replies
4. Shell Programming and Scripting
Hi there,
I have nested case in my script. I am asking user, want to continue? if user press y/Y then my inner case should continue, rather than that my code start from beginning. I would like to continue my inner case until user press n or N. Is any one tell me how can I do?
Thanking You,... (2 Replies)
Discussion started by: kasparov
2 Replies
5. Shell Programming and Scripting
I'm just having a bit of trouble running this code. It tells me that there's a syntax error on line 29. Any help appreciated.
#!/usr/bin/perl
#
# Phone Book Application
#
%phonebook = (
"Wayne", '34687368',
"Home", '378643287',
"Work", '017374637',
"School",... (2 Replies)
Discussion started by: cabaiste
2 Replies
6. UNIX for Dummies Questions & Answers
Hi all!
I'm really hoping you can help me out here; now i have searched and searched and have at least worked out that you can't have a nested if statement with a 'done' in it (as i have) as you're killing the parent before the child.
So here's what i have, and here's hoping someone can help... (2 Replies)
Discussion started by: dalgibbard
2 Replies
7. 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
8. Shell Programming and Scripting
Hi
I wanted to know if we can write a nested case in UNIX script.
Something like following -
Case ${sDB} in
Srvr1)
case ${sSchema}
Sch1)
DBusr=Username1
DBPwd=Pwd1
;;
Sch2)
DBusr=Username2
... (1 Reply)
Discussion started by: sumeet
1 Replies
9. 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
10. Shell Programming and Scripting
Hi -
Trying to take a list of ldap suffixes in a file, run an ldapsearch command on them, then run a grep command to see if it's a match, if not, then flag that and send an email alert.
The list file (ldaplist) would look like -
***********
o=company a
o=company b
***********
**... (7 Replies)
Discussion started by: littlefrog
7 Replies