zsh-users
 help / color / mirror / code / Atom feed
* Check write permissions
@ 2014-07-16 13:26 Sepp Tannhuber
  2014-07-16 14:14 ` Kurtis Rader
  2014-07-16 15:51 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Sepp Tannhuber @ 2014-07-16 13:26 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

I am looking for an easy solution to monitor in my prompt whether PWD
has write permissions or not. I use something like this:
  my_variable="${$([[ -w $PWD ]] || echo 0):+my_value}"

This sets $my_variable to my_value when there are no write permissions.
Although this works, it looks very complicated, especially with the echo command.
And I am wondering if there is a more elegant solution. Does anybody have an idea?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-16 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16 13:26 Check write permissions Sepp Tannhuber
2014-07-16 14:14 ` Kurtis Rader
2014-07-16 15:51 ` Bart Schaefer
2014-07-16 16:26   ` Sepp Tannhuber

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).