Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-17-2007, 08:52 AM   #1
LQ Newbie
Registered: Dec 2005
Posts: 23

Rep: Reputation: 15
Simple Bash Script

I need to put the contents of a file
file.txt in a bash variable...

something like
"cat file.txt>$TXT"
(this doesn´t work)

can you help me ?
Old 07-17-2007, 09:05 AM   #2
LQ Newbie
Registered: Aug 2004
Location: Dendermonde, Belgium
Distribution: Ubuntu latest
Posts: 28

Rep: Reputation: 15
This might work:

TXT=`cat file.txt`
echo $TXT

Old 07-17-2007, 09:07 AM   #3
Registered: Apr 2007
Location: Milano, Italia/Варна, България
Distribution: Ubuntu, Open SUSE
Posts: 212

Rep: Reputation: 37


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help regarding my very simple bash script hottdogg Programming 3 05-02-2007 02:09 AM
Simple bash script help zok Linux - General 4 12-15-2006 11:56 AM
Simple Bash Script Help njdownes Programming 2 03-05-2005 07:35 AM
Help with simple bash script - please tw001_tw Linux - Software 5 12-19-2004 09:02 PM
Simple BASH script fio Linux - General 5 01-18-2003 03:26 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:22 PM.

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