Last active
February 5, 2020 13:13
-
-
Save jwendell/38ab31ece1394aa7b6e21287dfe2b146 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
A=$(date +%Y-%m-%dT%H-%M-%S) | |
B=`date +%Y-%m-%dT%H-%M-%S` | |
while true; do | |
echo $A | |
echo $B | |
sleep 2 | |
done |
I made the modifications as I had suggested:
sdake@beast-01:~/go/src/istio.io/test-infra$ more jwen.sh
#!/bin/bash
A=$(date +%Y-%m-%dT%H-%M-%S)
B=$(date +%Y-%m-%dT%H-%M-%S)
while true; do
echo A=$A
sleep 2
echo B=$B
done
and the result is
sdake@beast-01:~/go/src/istio.io/test-infra$ ./jwen.sh
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
B=2020-02-05T06-12-15
A=2020-02-05T06-12-15
which looks like $(...) is working correctly...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
move sleep from line 9 to preceed line 8. Have line 8 echo $A instead of $B.