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
while read -a line; this is not working in ksh. what is the equivalent of this in ksh.
read: -a: unknown option (2 Replies)
Discussion started by: archana25
2 Replies
3. 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
4. Shell Programming and Scripting
Hi,
I am trying to write a code, where it reads the jobnames from a file and checks for the logs in the server. If the log is not found in the first server, then it will ssh to the 2nd server and get the details from there. I will need to save the date in a variable.
But the problem is that,... (0 Replies)
Discussion started by: ajayakunuri
0 Replies
5. Shell Programming and Scripting
Hi,
I am trying to read a file line by line inside of a while loop. This while loop is part of a here document.
while read line
do
ssh -t $2@$remotehost <<REMOTE
ls path/to/dir > $path_to_dir
while read line1
do
echo "LINE --- $line"
done... (4 Replies)
Discussion started by: mnanavati
4 Replies
6. Shell Programming and Scripting
Hi all
Is there a way to read and process a gzip file line by line similar to a text file without using gzcat..
while processing a text file we will usually use the logic
exec<sample.txt
while read line
do
echo $line
done
Is there a similar way to process the gz file in the same... (4 Replies)
Discussion started by: aikhaman
4 Replies
7. Shell Programming and Scripting
So i have a file which contains paths to JPG images separated by a space.
I have to separate them each path to another file. So, I have to search all strings that start from /home/ and ends with .jpg or .png
Then write each one to another file...
Can you please help me on doing this???:cool: (11 Replies)
Discussion started by: hakermania
11 Replies
8. Shell Programming and Scripting
I am using the while-loop to read a file.
The file has lines with null-terminated strings (words, actually.)
What I have by that reading - just a first word up to '\0'!
I need to have whole string up to 'new line' - (LF, 10#10, 16#A)
What I am doing wrong?
#make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies
9. Shell Programming and Scripting
I have a script consisting of certain functions whose input is a file at same location. In that file i have written the name of anothe file at same location. The third file contains a word which act as a function in the first script.Let me give an example
i have a scrip file say 1.sh in which i am... (7 Replies)
Discussion started by: sumitdua
7 Replies
10. 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