“Timestamp em Bash” Respostas de código

Obtenha shell atual de registro de data e hora

// If you want to get unix timestamp, then you need to use:
timestamp=$(date +%s)
GutoTrosla

Bash Obtenha o registro de data e hora

# 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
Encouraging Eland

Timestamp em 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
alxTools

Unix Timestamp Bash

date +%s 

# Give the number of seconds since epoch
Graceful Gull

Respostas semelhantes a “Timestamp em Bash”

Perguntas semelhantes a “Timestamp em Bash”

Mais respostas relacionadas para “Timestamp em Bash” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código