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

Ralf Mardorf silver.bullet at zoho.com
Fri Mar 24 18:45:33 CET 2017


Off-topic for this list, so just a very short remark.

On Fri, 24 Mar 2017 09:34:19 -0700, Victoria Stuart (gmail) wrote:
> "No need for basename, and especially no need for a subshell
> running pwd (which adds an extra, and expensive, fork operation); the
> shell can do this internally using parameter expansion ..."

Yes, "pwd" might slow down performance and perhaps only would be useful
if the "-P" option is required [1], that's why I first mentioned
"basename "$PWD"". I don't know if the "printf" command is faster than
the "basename" command. If I need a fast script, I would chose dash
instead of bash and test if "basename "$PWD"" does the job as fast as
"printf". An external command not necessarily is slower, but of course
using the "PWD" variable most likely is faster than using the "pwd"
command. At least dash is much faster than bash. So assuming bashisms
aren't needed, I prefer dash over bash.

Regards,
Ralf

[1]
[rocketmouse at archlinux hello_world]$ ls -hAl ../world
total 0
lrwxrwxrwx 1 rocketmouse rocketmouse 9 Mar 24 18:34 hello_world -> ../hello/
[rocketmouse at archlinux hello_world]$ echo "$PWD"
/home/rocketmouse/Desktop/world/hello_world
[rocketmouse at archlinux hello_world]$ pwd
/home/rocketmouse/Desktop/world/hello_world
[rocketmouse at archlinux hello_world]$ pwd -P
/home/rocketmouse/Desktop/hello




More information about the Users mailing list