Register and join over 40,000 other developers!
Recent Topics
-
The Game You Are Waiting For?
WendellHarper - Dec 06 2020 01:21 PM
-
Quora and Reddit Backlinks
WendellHarper - Dec 06 2020 01:14 PM
-
Delete account
pindo - Jul 23 2020 01:33 AM
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

Getting input from user
Started by
restin84
, Sep 24 2011 12:08 PM
3 replies to this topic
#1
Posted 24 September 2011 - 12:08 PM
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?
#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.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download