The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Read the csv file and assign the values in to variable rajbal Shell Programming and Scripting 11 06-27-2009 02:17 PM
how to check a word in a file and assign to a variable hippo2020 Shell Programming and Scripting 1 06-28-2007 01:00 PM
search file for word, then assign to variable dejit UNIX for Dummies Questions & Answers 2 03-06-2007 01:57 PM
How to Read a config file and Assign to Variable redlotus72 UNIX for Dummies Questions & Answers 1 11-13-2006 12:14 PM
Assign value to a variable in a parameter file gopskrish Shell Programming and Scripting 2 06-22-2005 08:26 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 3.00 average. Display Modes
  #1 (permalink)  
Old 12-01-2008
iamgeethuj iamgeethuj is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 38
How to assign the content of a file to a variable?

Hi all,
I have a problem here. I have a file and let we take the content of the file is just '32' (only a numeric value in that file). Now I need to assign this numeric value ( value in that file) to a variable. Is that possible? If so, can you plz advice me on this?

Thanks in advance!!!

Geetha
  #2 (permalink)  
Old 12-01-2008
manikantants manikantants is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 131
read variable_name < file_name
  #3 (permalink)  
Old 12-01-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Or even


Code:
variable_name=$(<file_name)

  #4 (permalink)  
Old 12-01-2008
iamgeethuj iamgeethuj is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 38
Thanks for your timely help!!!
  #5 (permalink)  
Old 12-01-2008
iamgeethuj iamgeethuj is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 38
Thank u Vino
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0