LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-15-2014, 11:14 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
The date command.


Code:
semoi@server:~/Downloads/nvidia$ date 05160115
date: extra operand '05160115'
Try 'date --help' for more information.
semoi@server:~/Downloads/nvidia$
What am I doing wrong?
 
Old 05-15-2014, 11:45 PM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Are you trying to set the date to May 16 0115 or is 0115 a time reference?

Last edited by dijetlo; 05-15-2014 at 11:59 PM. Reason: I answered my own question
 
Old 05-16-2014, 12:10 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I appended a note to my post but it must have done something wrong because I don't see there now. I had previously made an alias of 'date' and the system was taking the alias instead of the real command.
 
Old 05-16-2014, 04:32 AM   #4
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
You know, oddly enough you're the second person this week to ask me why aliasing a shell built in with the name of a shell built in is giving you unexpected output.
I know technically you should be able to do it, the aliases load after the shell so the alias should supersede the built-in...what was your alias for date? If it was built on "date"
Code:
alias date ='date -?'
it may have worked, however the underlying utility, once accessed, is just throwing a familiar error.

Last edited by dijetlo; 05-16-2014 at 04:41 AM. Reason: Non responsive
 
Old 05-16-2014, 09:27 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
date 05160115
works on Ubuntu 12.04.4 and Ubuntu 9.04 and CentOS 5.10 also
and spits out
Code:
Fri May 16 01:15:00 PDT 2014
on those.
Slackware 14, not so much:
Code:
date: cannot set date: Operation not permitted
Fri May 16 01:15:00 EDT 2014

It all depends on what the intent is, and the OS, of course.
maybe there's an alias for date already set?
try
Code:
\date 05160115
and if that 'works' as expected, then
Code:
alias date
will show you what's been set for it, if exists.

Last edited by Habitual; 05-16-2014 at 09:28 AM.
 
1 members found this post helpful.
Old 05-16-2014, 09:58 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Quote:
Originally Posted by stf92 View Post
I appended a note to my post but it must have done something wrong because I don't see there now. I had previously made an alias of 'date' and the system was taking the alias instead of the real command.
Glad you got it resolved. I thought the use of date was correct, and the fact that there was an alias explains it. Can you please mark the thread as solved.
 
Old 05-16-2014, 05:38 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I power post too much.

Anyway the "\" escapes any alias if there is one.
Code:
type <alias>
also works, same as alias <alias> to 'see' what's what.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] date command sryzdn Linux - Newbie 5 02-15-2014 11:37 AM
date command Volcano Linux - Newbie 17 04-25-2012 06:41 PM
help in date command mmhs Linux - Newbie 2 12-17-2010 03:37 PM
date command miran_shahverdyan Linux - General 4 10-14-2009 06:59 AM
command for date DarReNz Solaris / OpenSolaris 7 09-05-2006 09:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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