Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Check write permissions



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?


Messages sorted by: Reverse Date, Date, Thread, Author