Re: Feature request: Add "import" built-in.

2014-08-25 Thread Greg Wooledge
On Sun, Aug 24, 2014 at 01:36:38PM +0200, Tim Friske wrote: > I currently emulate the behavior I seek for with the following function: > > function _import { > local -r file="$1" > set -- "${@:2}" > source "$file" "$@" > } How is this different from source, exactly? You're passing all of t

Re: Feature request: Add "import" built-in.

2014-08-25 Thread lolilolicon
On Mon, Aug 25, 2014 at 8:04 PM, Greg Wooledge wrote: > On Sun, Aug 24, 2014 at 01:36:38PM +0200, Tim Friske wrote: >> I currently emulate the behavior I seek for with the following function: >> >> function _import { >> local -r file="$1" >> set -- "${@:2}" >> source "$file" "$@" >> } > > Ho

Re: Feature request: Add "import" built-in.

2014-08-25 Thread Greg Wooledge
On Mon, Aug 25, 2014 at 11:10:31PM +0800, lolilolicon wrote: > On Mon, Aug 25, 2014 at 8:04 PM, Greg Wooledge wrote: > > On Sun, Aug 24, 2014 at 01:36:38PM +0200, Tim Friske wrote: > >> I currently emulate the behavior I seek for with the following function: > >> > >> function _import { > >> loc

minor: "read line" may read several lines if stdin is a tty

2014-08-25 Thread Stephane Chazelas
If you run (here testing on Linux): bash -c 'read a; echo "<$a>"; tr b c' And enter aaabbb You see "", but not "ccc". That's because "read" reads up to 128 bytes of data in one read(2) invocation instead of reading one byte at a time like on other types on non-seekable files. Probably not a b

backslash at end of input causes eval parse error

2014-08-25 Thread jim . avera
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share

Final backslash causes array assignment mis-parse in previous eval

2014-08-25 Thread jim . avera
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share