help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] regex for allowed names of bash variables


From: address@hidden
Subject: Re: [Help-bash] regex for allowed names of bash variables
Date: Thu, 31 Dec 2015 09:11:15 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Here is how I check this, it works on all posix shells.

  check_valid_var_name() {
    case "${1:?Missing Variable Name}" in
      [!a-zA-Z_]* | *[!a-zA-Z_0-9]* ) return 3;;
    esac
  }


On 12/31/2015 5:26 AM, Peng Yu wrote:
Hi, I want to know the exact definition of allowed as bash variable
names. Could anybody know the regex for it?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]