From: Rocky B. <roc...@gm...> - 2008-08-05 11:41:21
|
Copyright added. Sure, getting into bash is probably a good thing to do. I thought somewhere I saw a builtin function called something like SETVAR0 for zsh which does the same thing. I don't see it now though. But the idea is that if there are other corresponding builtin functions for other shells, I'd like to try to call this the same thing and have it work the same way. Which reminds me about readarray. zsh does have a builtin function called mapfile. However that doesn't work like readarray. Instead it reads a file in as a string preserving and newlines are inside the string. You'd still have to split the string into an array. The purpose of set0 in the debugger is that users often write programs that refer to $0. For example to display a usage string or maybe they change the behavior based on how they were called. So this helps in making these programs act the same way and gives an alternative to invoking with "bash --debugger". On Tue, Aug 5, 2008 at 1:11 AM, Masatake YAMATO <ya...@re...> wrote: >> As usual, you are correct. I've also updated the unit test in >> test/unit/test-set0.sh.in so it would have caught at least one of the >> flaws. > > Should I push set0 to Chet Ramey? > If yes please put copyright notice to set0.c. > > Masatake YAMATO > |