The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > Linux > SuSE
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-30-2007
rajranibl rajranibl is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 5
inconsistent ls command display at the command prompt & running as a cron job

Sir,
I using the following commands in a file (part of a bigger script):
#!/bin/bash
cd /opt/oracle/bin
ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out

If I run this from the command prompt the result is:

2007-05-16

if I run it as a cron job then I get:

May

In both cases I need to get:

2007-05-16
Can any help with this?


Thanks in advance.