You are not logged in.
Pages: 1
Hello. I am now successfully running arch, and thought I should register to join and learn. However, the answer to the registration question "date -u +%V$(uname)|sha512sum|sed 's/\W//g'" persistently was wrong. Luckily I searched to eventually find that "Linux" can be substituted for "$(uname)", and now I can post this question. (Perhaps that itself is a test to discern if the applicant can look things up?)
While "uname" returns "Linux", "$(uname)" means nothing, and "%V$ is not a valid format option for the date command. What does the dollar sign mean, and do I have something wrong with my system to give that problem?
Last edited by fromagegb (2018-06-05 20:15:36)
Offline
$(uname) the string of the result of a subshell executing uname. According to man 1 date %V is a valid format control sequence.
Offline
Your clock was likely wrong.
Offline
Both the process substitution of $(...) and the date parameters are POSIX-compliant, so even if you are not using BASH as your shell, it should work fine ... unless of course you are using something like fish or maybe xonsh, or some other exotic non-POSIX-compatible (as it not even a superset of POSIX) shell.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks all. Marking as solved even though I am using bash, had not changed the clock at all, and echo $(uname) does indeed return Linux
I am in, and I can learn what subshells are all about.
Offline
Pages: 1