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
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
4. 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
5. Shell Programming and Scripting
Hi there,
I have two input files. I need to match the last two columns of each line in File1 with the first two columns of a line in File2. Example:
File1
AAA BB 234 789
BBB CC 426 624
CCC DD 356 643
File2
766 332 12
234 789 64
122 633 23
426 624 88
777 453 22
356 643 92
... (3 Replies)
Discussion started by: palex
3 Replies
6. UNIX for Dummies Questions & Answers
Hiii
I wanna a read a line of text from standard input. The user enter data like this way
name phone_no month1_salary month2_salary
that is user enter the name ,phone no and salary of 2 months in a single line by giving spaces. I wanna add the 3rd and 4th fields ...ie add both... (4 Replies)
Discussion started by: krishnampkkm
4 Replies
7. 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
8. UNIX for Dummies Questions & Answers
Ok, I am brand new to UNIX and I am trying to learn a cross between basic script and database use. I had got some ideas off the net on simple ideas for learning UNIX. I am working on creating a simple phone book program that allows myself to enter our employees from work into a phone book text... (0 Replies)
Discussion started by: georgefurbee
0 Replies
9. Shell Programming and Scripting
Hello, i know how to retrieve a user input (read), and how to manage the different options (case statement).
But... could anybody show me a script that, if the user option is incorrect, don't allow to continue the excution, i.e., if the value entered is not 1 or 2, the script shows a question.
... (2 Replies)
Discussion started by: aristegui
2 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