LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-30-2010, 04:14 AM   #1
balakrishnay
Member
 
Registered: Sep 2009
Posts: 31

Rep: Reputation: 15
Read Command


Hi,

read command will consider as one word irrespective of spaces in the word for ex :-


test case will be considered as one word incase if you assign this to one variable . But as per my requirement i want distribute the words like test and another word as case. How to do this can you any one help me out in doing this .

Regards

Bala
 
Old 01-30-2010, 04:41 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I don't understand your question.

Which language are you asking about?

If shellscript, then in bash the read command allows assigning words from a line to several variables; all the remaining part of the line goes in the last variable:
Code:
c:~$ read var1 var2 var3
a b c d e f
c:~$ echo $var1
a
c:~$ echo $var2
b
c:~$ echo $var3
c d e f
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why read command not wroking in rc.6 indiajoe Slackware 7 06-17-2009 11:27 PM
tcsh read command? johnpaulodonnell Linux - Newbie 2 07-13-2007 07:53 AM
Read command. unreal128 Linux - Software 2 09-30-2005 12:44 PM
understanding read command as a test frankie_DJ Programming 11 08-08-2005 01:30 PM
Question about read command thepryme Linux - Newbie 1 10-22-2003 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration