Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to set environment variable to current date, epoch format?
#1
i'm writing a script which will be triggered each time a file is dropped into a folder. I'd like the script to set an environment variable to the current date/time in epoch format.

export timeElapsed=123456767

will save the var

date +%s

will provide a time value in integer format.

how to combine the two lines?
Reply
#2
surround the date command in ``, I think.
Reply
#3
export myTime=`date +%s`;
echo $myTime;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)