![]() |
|
|
|
|
|||||||
| 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 |
| [C++] File I/O (Reading from a Random-Access File) | VersEtreOuNe | High Level Programming | 0 | 02-12-2008 01:34 PM |
| reading from a file and pass as variables and ignore # in the file | konark | Shell Programming and Scripting | 4 | 11-08-2007 12:55 AM |
| Reading a file and writing the file name to a param file. | thebeginer | UNIX for Advanced & Expert Users | 1 | 10-05-2007 01:38 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 02:25 AM |
| Reading specific contents from a file and appending it to another file | dnicky | Shell Programming and Scripting | 5 | 10-04-2005 02:45 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
reading a file into a varable...
Hi all,
I have had a hunt round the net (and the forum (more importantly)) but carn't just see anything that helps. Does anyone care to put me out of my missery and tell me how to read a file into a variable? thanks, B14... aka... Marky Mark... |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
try this....
var="`cat file`" But what do you want to achive through this?? regards Apoorva kumar |
|
#3
|
|||
|
|||
|
well its pretty simple really to be honest. I have a couple of SQL scripts that output some numbers to file, I just want to read them into my script so that I can compare them.
Thanks I will try this out, Mark. |
|
#5
|
|||
|
|||
|
Well the above does work (under Solaris 5.8) but you see, the files that I am reading are only contain 1 set of numbers (eg could be 1, it could be 14,0954) so I just wanted to read them into a variable and use the numbers in another script.
Thanks for the replies though, Mark. |
|||
| Google The UNIX and Linux Forums |