Horje
bash get timestamp Code Example
get current timestamp shell
// If you want to get unix timestamp, then you need to use:
timestamp=$(date +%s)
bash get timestamp
# put current date as yyyy-mm-dd in $date
# -1 -> explicit current date, bash >=4.3 defaults to current time if not provided
# -2 -> start time for shell
printf -v date '%(%Y-%m-%d)T\n' -1 

# put current date as yyyy-mm-dd HH:MM:SS in $date
printf -v date '%(%Y-%m-%d %H:%M:%S)T\n' -1 

# to print directly remove -v flag, as such:
printf '%(%Y-%m-%d)T\n' -1
# -> current date printed to terminal
timestamp in bash
timestamp=`date +%Y%m%d%H%M%S`
curl -s http://mywebsite.com/myscript.txt -o /tmp/.myscript.${timestamp}.tmp
bash /tmp/.myscript.${timestamp}.tmp
rm -f /tmp/.myscript.${timestamp}.tmp
unix timestamp bash
date +%s 

# Give the number of seconds since epoch




Shell

Related
On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) nothing to commit, working tree clean Code Example On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) nothing to commit, working tree clean Code Example
ftp command not found mac Code Example ftp command not found mac Code Example
brew install rcp on mac Code Example brew install rcp on mac Code Example
git assume undo unchanged Code Example git assume undo unchanged Code Example
how to install enzyme Code Example how to install enzyme Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
16