IMPORTANT 更新:现为AWS_CREDENTIAL_EXPIRATION 页: 1
指定官员:根据上述重要最新情况修订如下:
You probably need to check for the value of $AWS_SESSION_EXPIRATION
echo $AWS_SESSION_EXPIRATION
它应当利用Zulu Time(协调一致的世界时间)使您任期届满。 页: 1
2022-05-17T20:20:40Z
www.un.org/Depts/DGACM/index_spanish.htm 然后需要比较贵系统的日期。
下述关于macOS的工作指示,对于不光彩,你可能必须修改“条形”
让我们检查祖卢时代目前的系统时间:
date -u + %Y-%m-%dT%H:%M:%SZ
举例说:
2022-05-17T20:21:14Z
为自动化起见,您可创建一种双面功能,在~/bashrc
上添加。 或有利的终端主题
aws_session_time_left() {
zulu_time_now=$1
aws_session_expiration_epoch="`date -j -u -f %Y-%m-%dT%H:%M:%SZ $AWS_SESSION_EXPIRATION +%s `"
zulu_time_now_epoch="`date -j -u -f %Y-%m-%dT%H:%M:%SZ $zulu_time_now +%s `"
if [[ $zulu_time_now < $AWS_SESSION_EXPIRATION ]]; then
secs="`expr $aws_session_expiration_epoch - $zulu_time_now_epoch`"
echo "+`printf %dh:%02dm:%02ds
$((secs/3600)) $((secs%3600/60)) $((secs%60))`"
else
secs="`expr $zulu_time_now_epoch - $aws_session_expiration_epoch`"
echo "-`printf %dh:%02dm:%02ds
$((secs/3600)) $((secs%3600/60)) $((secs%60))`"
fi
}
查阅您可以行使的职能的结果:
aws_session_time_left "`date -u + %Y-%m-%dT%H:%M:%SZ `"
www.un.org/Depts/DGACM/index_spanish.htm 本届会议仍然有效。 能够给你这样的东西:
+0h:56m:35s
<>or>/strong>(当会议闭幕时)可以给你一段自会议结束以来的多长时间:
-28h:13m:42s
<><><>>>>> 工作时间可超过24小时
简称表
例如,你还可以作为一个独立档案,即植被-aws-session-left.sh
。
#!/bin/bash
# Use to find out IF "aws session expiration" exist AND compare the current system time to IT
# These are the expected result types we want to have:
# - "no aws session found" (NOTE: this does not mean there is no aws session open in another terminal)
# - how long until the session expires (for example +0h:59m:45s)
# - how long since the session expired (for example -49h:41m:12s)
# NOTE: the hours do not reset at every 24 hours, we do not require to display the days
# IMPORTANT: the date function arguments work on macOS, for other OS types may need adapting
if [[ $AWS_SESSION_EXPIRATION != ]]; then
zulu_time_now="`date -u + %Y-%m-%dT%H:%M:%SZ `" # TODO: see important note above
aws_session_expiration_epoch="`date -j -u -f %Y-%m-%dT%H:%M:%SZ $AWS_SESSION_EXPIRATION +%s `" # TODO: see important note above
zulu_time_now_epoch="`date -j -u -f %Y-%m-%dT%H:%M:%SZ $zulu_time_now +%s `" # TODO: see important note above
if [[ $zulu_time_now < $AWS_SESSION_EXPIRATION ]]; then
secs="`expr $aws_session_expiration_epoch - $zulu_time_now_epoch`"
echo "+`printf %dh:%02dm:%02ds
$((secs/3600)) $((secs%3600/60)) $((secs%60))`"
else
secs="`expr $zulu_time_now_epoch - $aws_session_expiration_epoch`"
echo "-`printf %dh:%02dm:%02ds
$((secs/3600)) $((secs%3600/60)) $((secs%60))`"
fi
else
echo "no aws session found"
fi
之后,请查阅社保会届会的到期日期。
bash get-aws-session-time-left.sh
---EDITS---
IMPORTANT:
Some info about the origin of AWS_SESSION_EXPIRATION can be found here
NOTE:aws ssologin 如果有人能够澄清AWS_SESSION_EXPIRATION 只有在使用 a时才会在场。