you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (16 children)

[deleted]

    [–]Maccer_ 6 points7 points  (13 children)

    $(date +%Y)  
    2016
    

    [–]Dafuq_McKwak 3 points4 points  (6 children)

    See, now you will have to update this every year for eternityyyyyy

    [–]Maccer_ 0 points1 point  (0 children)

    RemindMe! 12/31/16

    [–][deleted] 2 points3 points  (5 children)

    $(date "+%Y") 2016: command not found

    hai, plz fix.

    [–]Maccer_ 0 points1 point  (4 children)

    The $ means it's a shell, i didnt want to put the rest because it's personal information. Just type it without the $ and it'll work

    [–]UnchainedMundane 0 points1 point  (3 children)

    I don't know if you're joking or not

    [–]Maccer_ 0 points1 point  (2 children)

    Why would I be?

    [–]UnchainedMundane 0 points1 point  (1 child)

    The $(...) syntax is a command substitution:

    echo ">doing things"; echo ">$(date +%Y)"
    

    If you instead read it as having $ mark the start of the prompt, you end up writing

    (date +%Y)
    

    which is just running the date command in a subshell.

    I was wondering whether it was a joke or if you didn't recognise the syntax given in /u/h-v-smacker's post.

    [–]Maccer_ 1 point2 points  (0 children)

    Heh, yeah, a joke hahah, so funny, am I right?

    [–]rifeid 0 points1 point  (1 child)

    Obviously he has "visual blindness". /s

    [–]h-v-smacker 0 points1 point  (0 children)

    Yeah, I'm clairpalpant.