bug-bash
[Top][All Lists]
Advanced

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

Re: mapfile documentation


From: Greg Wooledge
Subject: Re: mapfile documentation
Date: Fri, 16 Mar 2018 15:40:02 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Mar 16, 2018 at 02:59:53PM -0400, Greg Wooledge wrote:
> On Fri, Mar 16, 2018 at 02:06:09PM -0400, Boruch Baum wrote:
> >    echo $IFS |xxd
> >    00000000: 0a
> 
> This command will never reveal any information, period.

I was slightly mistaken there.  It actually reveals the number of
non-IFS-whitespace characters in IFS (sometimes).  You can calculate
this by adding 1 to the number of spaces that echo puts in between the
null arguments that it receives.

Unless, of course, echo prints zero space characters -- in which case
you can't tell whether it received zero arguments, or one null
argument, as the resulting output is the same in both cases.

https://mywiki.wooledge.org/Quotes

wooledg:~$ IFS=qqqq
wooledg:~$ args $IFS
4 args: <> <> <> <>
wooledg:~$ echo $IFS | od -An -tx1
 20 20 20 0a

echo wrote three space characters, so we can conclude that IFS had 4
non-IFS-whitespace characters.  We cannot conclude anything more,
unless I've missed another thing.



reply via email to

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