Register
It is currently Sat Nov 01, 2014 4:11 am

$(/bin/date '+%Y') 2013 command not found


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Tue Jul 23, 2013 7:53 am   

Joined: Tue Jul 23, 2013 7:40 am
Posts: 2
I'm going crazy... The return is always 2013 command not found. I can reproduce it on all ubuntu Versions + cygwin.

What's wrong?!


Top
 Profile  
 PostPosted: Tue Jul 23, 2013 9:09 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
Well, you haven't included much info, no context at all, however if the line is really just the following;

Code:
$(/bin/date '+%Y')


Then that would run the date command and then try to run the resulting output as a command, therefore the error "2013 command not found"

If you just want the year echo'd then remove the subshell $() that's arround the command.

Code:
/bin/date '+%Y'


Top
 Profile  
 PostPosted: Tue Jul 23, 2013 9:21 am   

Joined: Tue Jul 23, 2013 7:40 am
Posts: 2
This line was for testing... The execution of the result is new to me :) Expected stdout.

thx!


Top
 Profile  
 PostPosted: Wed Jul 24, 2013 7:26 pm   
User avatar

Joined: Fri Jul 22, 2011 5:39 pm
Posts: 47
Code:
echo $(/bin/date '+%Y')
or
Code:
/bin/date '+%Y'


what DarthWavy "said". :)


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP