[Users] Q. re: tags (tagging locally-saved messages for use outside Claws)
Ralf Mardorf
silver.bullet at zoho.com
Fri Mar 24 07:06:59 CET 2017
On Fri, 24 Mar 2017 07:01:22 +0100, Ralf Mardorf wrote:
>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
My apologies,
I "forgot" the quotes.
[rocketmouse at archlinux ~]$ cd Desktop/stupid\ space/
[rocketmouse at archlinux stupid space]$ basename $PWD
stupid
[rocketmouse at archlinux stupid space]$ basename "$PWD"
stupid space
[rocketmouse at archlinux stupid space]$ basename $(pwd)
stupid
[rocketmouse at archlinux stupid space]$ basename "$(pwd)"
stupid space
More information about the Users
mailing list