[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: consistency probs var & function re-use
From: |
Charles Daffern |
Subject: |
Re: consistency probs var & function re-use |
Date: |
Sat, 10 Jun 2017 15:16:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
> First problem: If you are assigning a string to a variable,
> you need to put quotes around the string. That shows that "-p"
> doesn't insert newlines:
>
> > x="$'foo\nbar'"
> > declare -p x
> declare -- x="\$'foo\\nbar'"
You do not have any newlines in that string, so of course the
demonstration with -p will show no newlines.
>> What are you trying to do?
> Read var & func defs via a 'read' of 1 line.
In your variable "x" above, you have encoded the string in a format
which contains no raw newlines and which can be "eval"ed to produce the
original contents.
Why don't you encode the function the same way?
signature.asc
Description: OpenPGP digital signature
- Re: consistency probs w/ 'readonly -f' & 'export -f, (continued)
- Re: consistency probs w/ 'readonly -f' & 'export -f, Chet Ramey, 2017/06/11
- Re: consistency probs var & function re-use, L A Walsh, 2017/06/09
- Re: consistency probs var & function re-use, Chris F.A. Johnson, 2017/06/09
- Re: consistency probs var & function re-use, L A Walsh, 2017/06/09
- Re: consistency probs var & function re-use, Chris F.A. Johnson, 2017/06/09
- Re: consistency probs var & function re-use, Chris F.A. Johnson, 2017/06/09
- Re: consistency probs var & function re-use, L A Walsh, 2017/06/11
- Re: consistency probs var & function re-use, L A Walsh, 2017/06/11
- Re: consistency probs var & function re-use, Chet Ramey, 2017/06/11
- Re: consistency probs var & function re-use, L A Walsh, 2017/06/11
- Re: consistency probs var & function re-use,
Charles Daffern <=
- Re: consistency probs var & function re-use, L A Walsh, 2017/06/11
- Re: consistency probs var & function re-use, Greg Wooledge, 2017/06/13