I am getting error in a shell script having a simple date command.
Error is " write to 1 failed [No space left on device] ".
We saw that /tmp folder was 100% full. When we cleared some space in /tmp folder then script worked fine. Why does date command(or any other command) require space in /tmp folder? Which settings define this? Any information on this is appreciated.
> cat test.ksh
DATE_TMSTP=`date +%Y%m%d_%H%M%S`
> ksh test.ksh
test.ksh: line 1: write to 1 failed [No space left on device]
OS version is "Red Hat Enterprise Linux Server release 5.10" . Thank you
Is descriptor 1 (stdout) of your current shell redirected to something in /tmp?
test -t 1 && echo "ok: is terminal"
Do you have an ENV environment variable (where ksh sources its value at startup)?
echo $ENV
If yes, bypass it with
ksh -p test.ksh
Is ksh /bin/ksh?
type ksh
Please find the details you have asked for:
1)
> test -t 1 && echo "ok: is terminal"
ok: is terminal
2) Nothing defined on $ENV
4)
> type ksh
ksh is hashed (/bin/ksh)
I am running out of ideas...
One more:
type date
thanks for your help anyway
$ type date
date is /bin/date