Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: help adapting bashism for zsh



On 06/10/2019 12:34 PM, Ray Andrews wrote:
> On 2019-06-10 7:53 a.m., Roman Perepelitsa wrote:
>> automatic translation of bash code to zsh. It's likely that your
>> requirements are unique. Usually systems that can afford to have zsh
>> can also afford to have bash, so no translation is necessary.
>>
> In my case I didn't want the bother of having to learn the idiosyncrasies of
> two shells.  I picked one and was hoping to never have to learn the other.  If
> I was planning to transition from bash to zsh, I'd be hoping to subsequently
> avoid bash altogether and thus go through the conversion trouble once but then
> forget about bash and do all further work in zsh.  So space considerations
> would be the least of my motives.  Just me, but zsh syntax is so abstruse that
> not only learning it, but also trying to remember the differences vis a vis
> bash, would seem brain blowing.
> 
> So it seems David will have to do it line by line.

  That's the interesting part. I have 2-decades of bash, which with the
bashisms makes that somewhat of a daunting challenge. The "2566 POSIX and bash
scripts" wasn't a guess, it was a 'find ~/scr -type f | wc -l' exercise. From
the days of loading Linux from floppy disks from boxed sets, you didn't really
have a lot of foresight as to the implications of shell choice, which is what
makes the shell differences now more acute.

  So the path forward seems like leaving all shells installed the only
solution and migrate the needed scripts one at a time. We shall see how it goes.

-- 
David C. Rankin, J.D.,P.E.



Messages sorted by: Reverse Date, Date, Thread, Author