![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read is not pausing to read | davegerdt | Shell Programming and Scripting | 3 | 04-07-2008 07:20 AM |
| ls while read loop - internal read picking up wrong input | dkieran | Shell Programming and Scripting | 2 | 05-14-2007 12:02 PM |
| Cannot read in variable using read on first try | normie | UNIX for Advanced & Expert Users | 1 | 10-04-2005 10:42 PM |
| read line and read next | ariuscy | UNIX for Dummies Questions & Answers | 7 | 09-21-2005 04:04 AM |
| read() | Deepa | IP Networking | 1 | 06-07-2002 05:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
about READ...please help!
hi guys i have a question:
i am creating an interactive programme and i need some help on the READ command. let's say that i use the echo command and ask something to my user in the form: echo 'Please, insert filenames: \c' then i read his/her answer with: read answer i need to test the answer given to see, for example, if the user has really chosen files and not directories for example so i use: if [[ -d $answer ]]; then echo 'Attention: you have selected a directory!' fi now my problem is this: if the user, instead of just one file, writes 2 or more files? i know i can write: read answer1 answer2 etc. but then it becomes too difficult to check all variables in the IF STATEMENT...and also...what if the user uses more variables than those i have specified? too complicated... any suggestion on how to include all the possible filenames the user could specify in just one variable to check? (a bit like $@ instead of "$1" "$2" etc.) hope my question is clear... thanks. |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|