The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
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 10-10-2008
mrx1350 mrx1350 is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 23
Date Format Does not work in Shell

I'm am able to format the date in the unix prompt using NOW=$(date +"%d%m%y"). However, when i put the same format into a shell script, it errors out with the followign.

sintax error on line 4: `NOW=$' unexpected.



#!/bin/ksh

EXP_LOC=/u02/oradata/exports
NOW=$(date +"%d%m%y")

echo $NOW
~
~
~
~
~
~
~
~
~
~
"test" 13 lines, 363 characters