[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not operator (~) fail on arithmetic expansion.
From: |
Andreas Schwab |
Subject: |
Re: Not operator (~) fail on arithmetic expansion. |
Date: |
Mon, 28 Nov 2016 09:37:52 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
On Nov 28 2016, John McKown <john.archie.mckown@gmail.com> wrote:
> Not replying for Chet, who will have the definitive answer, I will say that
> I, personally, think that is working as designed. ~ 0 (with space between)
> is definitely the "not" operator. But without the middle space, ~0, where
> there is a white space character in front of the tilde, looks to me like
> the normal "get the home directory for the following id" processing. Eg: ~0
> gets the home for the 0 user (same as ~user) whereas in "a~0", then tilde
> is simply a character. This is basically how ever other Bourne type shell
> seems to work.
In Bash, ~0 means the 0th entry of the directory stack, ie. $PWD.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."