msimerson / Mail-Toaster-6

Mail Toaster 6
https://github.com/msimerson/Mail-Toaster-6/wiki
BSD 3-Clause "New" or "Revised" License
47 stars 16 forks source link

Change the shell from `csh` to `sh` #444

Closed zenny closed 4 years ago

zenny commented 4 years ago

Hi @msimerson :+1:

Great script. However, the default FreeBSD shell is csh which the script refuses to run under in my case.

Won't it be good to add a line on top to change fromcsh to sh shell?

I had to exectute /bin/sh to get the script running, fyi.

Cheers, and stay safe /z

msimerson commented 4 years ago

Yes, the FreeBSD default shell is csh. Which I consider...less than great, so I used to always switch my login shell to tcsh, which is better. But both are awful for scripting. Initially I tried very hard to get the suite of scripts to play nicely with *csh, but running sh scripts under a *csh login always left something broken. That's why the very first line in the instructions is sudo sh. Once you're running under a sh/bash shell, then the behavior is deterministic.

Won't it be good to add a line on top to change fromcsh to sh shell?

On top of what? Does not every file already have a shebang line of #!/bin/sh. What more are you asking for?

zenny commented 4 years ago

Thanks, what I meant was to export $SHELL=/bin/sh for the specific session. Anyway it works great. Your explanations are pretty comprehensive and to the point, admirable @msimerson! Thank you.