Live data from Hacker News

Advanced Bash-Scripting Guide

tldp.org

1–10 of 17 posts

Re: Advanced Bash-Scripting Guide

#4
last update 2014

that being said, it think 10 years later, linux should pick a data oriented shell (powershell or nushell) and go full in on it

on windows, almost all services have some Powershell support

i understand that on linux, command line support is always there, so unlike windows adding command line support is not really news, but still i think the move to a data oriented shell, is better

Re: Advanced Bash-Scripting Guide

#6
post #3

There are many foot-guns to be found in bash scripting. I highly recommend the Wooledge wiki for any and all bash knowledge, it points every place you can go wrong, especially when using advanced features. https://mywiki.wooledge.org/FullBashGuide http://mywiki.wooledge.org/BashFAQ

Complementary - https://github.com/anordal/shellharden/blob/master/how_to_do...

Re: Advanced Bash-Scripting Guide

#7
post #4

last update 2014 that being said, it think 10 years later, linux should pick a data oriented shell (powershell or nushell) and go full in on it on windows, almost all services have some Powershell support i understand that on linux, command line support is always there, so unlike windows adding command line support is not really news, but still i think the move to a data oriented shell, is better

On Windows,

    mv s:\src d:\dest
Works as you expect. Now on some unimportant directory try:

    mv s:\src
I have to think hard about an equivalently-stressful typo on another interactive shell.

Re: Advanced Bash-Scripting Guide

#8
post #4

last update 2014 that being said, it think 10 years later, linux should pick a data oriented shell (powershell or nushell) and go full in on it on windows, almost all services have some Powershell support i understand that on linux, command line support is always there, so unlike windows adding command line support is not really news, but still i think the move to a data oriented shell, is better

On Windows, mv s:\src d:\dest Works as you expect. Now on some unimportant directory try: mv s:\src I have to think hard about an equivalently-stressful typo on another interactive shell.

I suppose in POSIX:

    sudo ifdown ens1 ; ifup ens1
But this one is easier to understand.

Re: Advanced Bash-Scripting Guide

#9
Mandatory comment every time the subject comes up: shellcheck is really helpful when writing Bash scripts.

shellcheck itself is not written in Bash (it's written in Haskell) but it gives really good hints and find lots of bugs. If you disagree with some of its warnings, you can choose which ones you want to turn off.

I use it from within Emacs and it works fine. Set that thing once, years ago, and it's been helping me ever since.

Also: shellcheck probably ships with your Linux distro.

Re: Advanced Bash-Scripting Guide

#10
post #4

last update 2014 that being said, it think 10 years later, linux should pick a data oriented shell (powershell or nushell) and go full in on it on windows, almost all services have some Powershell support i understand that on linux, command line support is always there, so unlike windows adding command line support is not really news, but still i think the move to a data oriented shell, is better

On Windows, mv s:\src d:\dest Works as you expect. Now on some unimportant directory try: mv s:\src I have to think hard about an equivalently-stressful typo on another interactive shell.

I think POSIX mv is terrifying enough. I've found it to be much more dangerous than dd or rm.
Post reply on HN