10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I have a script below that is running ssh <host> <command> on some servers.
Below is more or less the script. I have to modify it somehow to get rid of the 'confidential' hostnames
check_log.bash
#!/bin/bash
#
myPID=$$
parse_log ()
{
sub="parse_log"
host=${1}
... (2 Replies)
Discussion started by: newbie_01
2 Replies
2. 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
3. Shell Programming and Scripting
I'm looking for some help in figuring why my little bit of code will not process any entries other then the first one in my list.
while read line ;do
hostname=${line//\"}
a=`ssh user@$hostname uptime;echo $?`
if ];then
dt=`date`
touch... (6 Replies)
Discussion started by: whegra
6 Replies
4. Shell Programming and Scripting
hello guys,
i am having the below piece of code
error
()
{
echo"Press y /n"
read ans
case $ans in
y) main;;
n) exit
esac
}
In the abve code, read statement is not working i.e not waiting for user to enter input.
,i tested exit status its 1.
could anyone help me to do this
... (11 Replies)
Discussion started by: mohanalakshmi
11 Replies
5. UNIX for Dummies Questions & Answers
hi,
this is my script #!/bin/ksh
cat temp_file.dat | while read line
do
read test
if ]; then
break
else echo "ERROR"
fi
done
when i execute this code , the script does wait for the user input . it directly prints "ERROR" and terminates after the no. of times as there... (3 Replies)
Discussion started by: siva1612
3 Replies
6. Shell Programming and Scripting
Hi Guys..
need some urgent help... I am stuck in something badly
I need to write a script which would read a sql statement (which might be a join/inner join/select/sub select etc. )
I need to read that sql statement ... and in the output I want all the table names and columns (doesn't... (4 Replies)
Discussion started by: freakygs
4 Replies
7. Shell Programming and Scripting
Hi.
With the help of this group I have created a shell script to find the factorial of a number.
OK. Then I got wild.;) I tried to put in a check to make sure the entry is a number.
read num
If )) then
echo "This is not a valid number. Try again."
fi
while (( $var <= $num)) more... (5 Replies)
Discussion started by: Ccccc
5 Replies
8. Shell Programming and Scripting
Pls this is emergency.I have written a script which is taking input from another script. and the contents of my second script are acting as functions to my main script.Now the problem is that in one of the functions i want the script ececution to stop and start when user enters any character r... (2 Replies)
Discussion started by: sumitdua
2 Replies
9. UNIX for Dummies Questions & Answers
im trying to write an until statement which dont go onto the next stage until the user inputs a certain phrase. It is then stored in an array. Ive come up with this code so far but its not working and i dont know why.
read in1
until
do
echo "Incorrect, try again"
... (2 Replies)
Discussion started by: strasner
2 Replies
10. Shell Programming and Scripting
I understand this question probably poses some child like stupidity, but I can't get this if statement to work for love or money.
#!/bin/ksh
echo "Input either 1 or 2"
read Num
if ; then
echo "Message 1"
if ; then
echo "Message 2"
else
echo "false"
fi
$ ksh decisions
Input either 1... (6 Replies)
Discussion started by: Hazmeister
6 Replies