LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-30-2008, 04:43 AM   #1
wegadnie
Member
 
Registered: Oct 2007
Posts: 48

Rep: Reputation: 15
Variable or something else?


Hi all,

i have a question. From command
#date +%F
it shows me the date in right format (2008-10-30) but when i issue the command
#touch 'date +%F'.log
it doesn't name the file in right name format which i expected (2008-10-30.log). The other guy can do on his box so i think the problem is my side. What should i do in this situation?
 
Old 10-30-2008, 06:01 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Well, if we knew who "the other guy" was, we might be able to see what he was doing......

Seriously, is it possible that you used single quotes, when you needed to use backtics? To run a command and use its output inside another command, you need one of two forms:
command2 $(command1)
OR
command2 `command1`

In the second example, those are backtics (on a standard US Qwerty keyboard, top left--just above the tab key)
 
Old 10-30-2008, 06:52 AM   #3
wegadnie
Member
 
Registered: Oct 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Got it. You're the man. Thanks a lot.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
function showing a list of variable and value: (dynamic variable name) budhax Linux - Newbie 1 09-19-2008 07:05 PM
Help: removing a variable substring from a string variable in sh script gnparsons Programming 2 06-04-2008 05:21 PM
Replace variable with user defined variable ce124 Programming 10 04-13-2007 09:29 AM
setting a variable variable in a script... this works, but could it be more elegant? pwc101 Programming 3 08-18-2006 11:23 AM
Scripting: accessing a variable stored in a variable? tomolesonjr Linux - Newbie 5 05-05-2006 08:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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