recently I wanted to calculate the time difference of two dates (in days) using a one-liner in bash. So I wanted to use the command
echo $((($(date +%s --date "2018-01-08")-$(date +%s --date "1999-12-28"))/(3600*24))) days
which would yield "6586 days".
Out of clumsiness I forgot to type the finishing inverted commas in the first date entry:[ date +%s --date "2018-01-08 ]
I got this output:
echo $((($(date +%s --date "2018-01-08)-$(date +%s --date "1999-12-28"))/(3600*24))) days
bash: command substitution: Zeile 4: Dateiende beim Suchen nach »"« erreicht.
bash: command substitution: Zeile 5: Syntaxfehler: Unerwartetes Dateiende.
> ^C
rosika@rosika-10159:~$ echo $?
130
The error messages are clear I think but I didn´t get my command prompt back. The system seems to have been waiting for something. Yet it´s not clear me for what.
I finally entered "CTRL+C" and so I got my command prompt back. I hope I did the right thing there.
The error code was "130". Well, it´s clear to me that it couldn´t be "0".
What I´d like to understand is: what is it that the system could have been waiting for?
Perhaps some of you knowledgeable folks could shed some light on the matter?
Thanks a lot in advance.
Many greetings. Rosika
P.S.:
my system: Linux/Lubuntu 20.04.2 LTS, 64 bit