[Users] Q. re: tags (tagging locally-saved messages for use outside Claws)

Ralf Mardorf silver.bullet at zoho.com
Fri Mar 24 07:01:22 CET 2017


On Thu, 23 Mar 2017 19:28:40 -0700, Victoria Stuart (gmail) wrote:
>Posted at:
>http://stackoverflow.com/questions/9533679/how-to-insert-a-text-at-the-beginning-of-a-file/42989868#42989868
>
>Gist:
>https://gist.github.com/victoriastuart/7457b2727d21a37b7a79eb9a957b988d

Consider to write human readable scripts ;).

Instead of something cryptic like

  printf "${PWD##*/}\n"

I would use

  basename $PWD

or

  basename $(pwd)

[rocketmouse at archlinux Desktop]$ echo $PWD
/home/rocketmouse/Desktop
[rocketmouse at archlinux Desktop]$ printf "${PWD##*/}\n"
Desktop
[rocketmouse at archlinux Desktop]$ pwd
/home/rocketmouse/Desktop
[rocketmouse at archlinux Desktop]$ dirname $(pwd)
/home/rocketmouse
[rocketmouse at archlinux Desktop]$ basename $(pwd)
Desktop
[rocketmouse at archlinux Desktop]$ dirname $PWD
/home/rocketmouse
[rocketmouse at archlinux Desktop]$ basename $PWD
Desktop

Regards,
Ralf




More information about the Users mailing list