5 replies
by jeremyc
Try this (I dont' have a SCO machine to test on, but it should work):
cp filename filename`date |sed -e "s/ /_/g"`
Pay attention to the syntax above - the "single quotes" are backticks.
This will get you this:
"filename" gets copied to "filenameThu_Mar__9_18:51:04_MST_2000"
by tstad
by wcf
You are slightly ticked-off for SCO OS5.
The following suntax works.
cp filename `date +%m%d`filename
where ` is a backtic
But note that this actually creates a COPY of the file and if what you really want is to RENAME the file as you state, use
mv filename `date +%m%d`filename
The main thing here is that you enclose the COMMAND in backticks so that the shell executes it and replaces the COMMAND with its output
by tstad
by tstad
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending