Ideetron / Larank

Software for the Larank product range.
GNU General Public License v3.0
15 stars 12 forks source link

Changed cut field parameter to 6, as -f 7 returns nothing. #5

Closed swiatecki closed 8 years ago

swiatecki commented 8 years ago

Changed cut field parameter to 6, as -f 7 returns nothing.

root@lorank8:~/lorank8v1# date Sat May 14 10:10:04 UTC 2016 root@lorank8:~/lorank8v1# date | cut -d ' ' -f 7

root@lorank8:~/lorank8v1# date | cut -d ' ' -f 6 2016 root@lorank8:~/lorank8v1#

devlaam commented 8 years ago

Thank you for pointing out this error. However, the solution you propose is not clean either since both depend on the number of spaces between the fields. Very error prone. Nevertheless i am grateful for your tip. I will replace it with something like: date | awk '{print $NF}'

swiatecki commented 8 years ago

I agree it is error prone indeed, I would suggest "date +%Y"

devlaam commented 8 years ago

Yes, this is even better ... how hard can it be.

devlaam commented 8 years ago

I have followed your suggestion. Again, thank you for pointing this out.