I have an assignment to write a script which requires the user to input four lines of text. Those four lines of text will be manipulated in various ways. Is there a way to save these for lines of text before I save them in a file? Should I use the "read" command?
3 replies to this topic
#1
Posted 24 September 2011 - 12:08 PM
|
|
|
#2
Posted 25 September 2011 - 12:40 PM
What language? Or are you just making a shell script?
#3
Posted 27 September 2011 - 09:37 AM
Yes it is just a shell script
#4
Posted 04 October 2011 - 04:35 AM
For a shell script, you should use the read command four times and save each line in a variable.
There's no need to declare or initialize the variables. read declares them implicitly.
read line1; read line2; read line3; read line4;
There's no need to declare or initialize the variables. read declares them implicitly.
Programming is a journey, not a destination.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









