10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
#!/bin/bash
#Just trying to check if letters are in the user input. Any tips?
# I have tried regexp and using 0-9 etc, i cannot get this to work either in just an if statement or while in a loop.
echo "Please pick a number"
read num
if ; then
echo "Please enter a number"... (7 Replies)
Discussion started by: jvezinat
7 Replies
2. Shell Programming and Scripting
Hi,
This query is a part of a much more lengthy script.
I wish to look for all the files in a folder named "data" which in this case has two files i.e. plan.war and agent.properties. For all the files found under data I wish to ask the user as to where they wish copy the files to.
Below,... (14 Replies)
Discussion started by: mohtashims
14 Replies
3. Shell Programming and Scripting
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies
4. Shell Programming and Scripting
I have a shell script, and its pretty much done, I decided to add a loop that ends or continues depending on user input. like "would you like to continue?" and if I hit y or yes it will run the loop again until I hit n or no and breaks out of the loop.
To be hones I didn't think I needed to add... (2 Replies)
Discussion started by: Demon_Jester
2 Replies
5. Shell Programming and Scripting
Hi,
echo "Enter file name of input file list along with absolute path : "
read inputFileList
if
then
for string in `cat inputFileList`
do
echo $string
done
else
echo " file does not exist"
fi
From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies
6. Shell Programming and Scripting
Hi Dears,
I have one script to create new users with information in one plain text file. This script will read all lines in the file and create one users for one line.
Sample file:
#action;login,full name title,expire date,project
+;gmwen,Bruce Wen QA,04/01/2012,BT
+;xxdeng,Shown Deng... (4 Replies)
Discussion started by: crest.boy
4 Replies
7. Shell Programming and Scripting
until
do
read -p "Invalid cars. Try againa" cars1
done
Ok i have the above code, im getting users input and if it doesnt match in the file the user has to try again untill its correct
But when i run this it gives me an error saying
./Cars.bash: line 43: (2 Replies)
Discussion started by: gangsta
2 Replies
8. UNIX for Dummies Questions & Answers
What script can I use to catch errors in a shell script if user inputs alpha numeric characters instead on integers from the keyboard? (0 Replies)
Discussion started by: Pauline mugisha
0 Replies
9. UNIX for Dummies Questions & Answers
I'm new to BASH and i'm trying to create a script which is simply put a large find and replace file. This is what I have so far
N=0
while read LINE ; do
N=$((N+1))
sed 's/'$2'/'$3'/g' $LINE > .temp
echo "Changes to file $N = $LINE"
echo 'The following changes... (5 Replies)
Discussion started by: Azumandious
5 Replies
10. UNIX for Dummies Questions & Answers
hi!
i need to do a ksh script that uses a wile loop that is fed form below
while read line
do
some things
done < myfile
inside the while loop i need to read user input to ask the user what he wants to do, but "read" reads the file, and not the standard input
while read line
do
... (2 Replies)
Discussion started by: broli
2 Replies