Operating System - HP-UX
1755583 Members
3890 Online
108836 Solutions
New Discussion юеВ

Re: Queries on KSH scripts

 
SOLVED
Go to solution
Henry Chua
Super Advisor

Queries on KSH scripts

Hi,

I started my scipt with this on a HPUX10.20b,
"
#!/bin/ksh

#Date Initialisation
YY=`date +%Y`
MM=`date +%m`
DD=`date +%d`
HH=`date +%H`
MI=`date +%M`
SS=`date +%S` "

But the system returns "
YY=2005: Command not found.
MM=01: Command not found.
DD=13: Command not found.
HH=14: Command not found.
MI=05: Command not found.
SS=32: Command not found.
"
when I ran the script.. anyone know why this is so?

THanks!!
3 REPLIES 3
Biswajit Tripathy
Honored Contributor
Solution

Re: Queries on KSH scripts

I cut'n'paste yout exact script, put it in a new file and
ran it on HP-UX 11i and it ran without any of the
above mentioned error/warnings. Looks like something
is different on HP-UX 10.20. Just run "date +%Y"
at command line and see if it runs.

- Biswajit
:-)
Sanjay Kumar Suri
Honored Contributor

Re: Queries on KSH scripts

It should work.

Just check if they work individually:
$date
$YY=`date +%Y`
$echo $YY


sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Henry Chua
Super Advisor

Re: Queries on KSH scripts

Problem solved! thanks!