LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-19-2004, 06:20 PM   #1
redhatnoob
Member
 
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"

./$START


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, 06:24 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
START=`cat start.txt`
or
START=$(cat start.txt)
 
Old 08-19-2004, 06:25 PM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
START=`cat start.txt`
START=$(cat start.txt)
START=$(<start.tx)
 
  


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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