The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
add seconds to: date"|"time"|"HHMMSS anaconga UNIX for Advanced & Expert Users 3 08-27-2008 01:17 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
any command like "date $s" on Solaris? fedora UNIX for Dummies Questions & Answers 2 07-25-2006 02:32 PM
Unix "at" / "Cron" Command New Problem...Need help Mohanraj UNIX for Dummies Questions & Answers 3 01-26-2006 08:08 PM
"man date" command does not work aptit UNIX for Dummies Questions & Answers 1 02-15-2002 08:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2008
ajitkumar2 ajitkumar2 is offline
Registered User
  
 

Join Date: May 2008
Posts: 18
can't run "date" command

A strange observation -

$ ksh date
ksh: date: cannot execute

$ ksh "date"
ksh: date: cannot execute

$ ksh "date "
Thu Sep 18 09:22:12 CDT 2008



why the date command doesn't run without a space ??

Please help
  #2 (permalink)  
Old 09-18-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
ok - this is a slightly odd one...

correct syntax would be

ksh -c "date"

which works.

When you omit the -c, it looks like, from truss, if you pass " " then the ksh gets a SIGQUIT sent, and then the date command is ececuted seperately under your current shell.

As to exactly why it behaves like this.....not a clue
  #3 (permalink)  
Old 09-18-2008
broli's Avatar
broli broli is offline
Registered User
  
 

Join Date: Dec 2007
Location: Argentina
Posts: 215
maybe someone (some thing) moved the date command to "date "
(the file name has a space)
i have seen some weird (and imposible) names for files, like some amount of blank spaces (i never got to know how many)
  #4 (permalink)  
Old 09-18-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361

A shell runs shell scripts, not binaries.

If you have a space in the command, it is not a binary, but shell syntax.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0