Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-19-2004, 07:20 PM   #1
Registered: Jun 2003
Location: NY
Distribution: Red Hat 9
Posts: 66

Rep: Reputation: 15
BASH Command Result

I was trying to store a result of a command as a variable

START="cat start.txt"


But $START is the string. How do i put the result of cat as the variable?

start.txt is a one line text file with paramaters for a programs startup
Old 08-19-2004, 07:24 PM   #2
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
START=`cat start.txt`
START=$(cat start.txt)
Old 08-19-2004, 07:25 PM   #3
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,571

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
START=`cat start.txt`
START=$(cat start.txt)


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
Output the result of a command to a file darkarcon2015 Linux - Newbie 1 09-24-2005 07:29 PM
cannot export result from awk into a variable in a bash script Emmanuel_uk Linux - Newbie 4 03-07-2005 02:54 AM
Strange ip from the result of tracert command mrpc_cambodia Linux - Networking 4 01-25-2005 07:49 AM
php: output the result of exec( $command ) zovres Programming 6 08-27-2004 07:41 PM
cp command problem..... unexpected result hamster Linux - General 2 04-10-2003 05:57 PM

All times are GMT -5. The time now is 03:06 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