Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Check write permissions
- X-seq: zsh-users 18946
- From: Sepp Tannhuber <sepp.tannhuber@xxxxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Check write permissions
- Date: Wed, 16 Jul 2014 14:26:51 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1405517211; bh=cWEuJaMVIk6mMpB0Ej66lmLWFJz6fVitMyuLV02TNss=; h=Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=37ltLFlJ5vUlaNvDGbZPXNhdjVXZ3Wb6mTAt2TQOc42oAraLijqGCOfqrQ8xRrzG66uKQtomUFhQksgC9y6X5KnzRvpUTW7vHlyw91Ia5QPRrHohJ/ouTaq7EH9qBvjesPrUmbBavNMumUEvjgV6G99ChRvZuFVdIvFmUrvEUn4=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Reply-to: Sepp Tannhuber <sepp.tannhuber@xxxxxxxx>
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