nushell/crates/nu-command/src/system
Jelle Besseling a7c1b363eb
Don't run .sh files with /bin/sh (#8951)
# Description

The previous behaviour broke for me because I didn't have `sh` in my
path for my nu script. I think we shouldn't assume that just because a
file ends with `.sh` it should be executed with `sh`. `sh` might not be
available or the script might contain a hashbang for a different shell.

The idea with this PR is that nushell shouldn't assume anything about
executable files and just execute them. Later on we can think about how
non-executable files should be executed if we detect they are a script.

# User-Facing Changes

This may break some people's scripts or habits if they have wrong
assumptions about `.sh` files. We can tell them to add a hashbang and +x
bit to execute shell scripts, or prepend `bash`. If this a common
assumption something like this should be added to the book

# Tests + Formatting

I only tested manually and that did work

# After Submitting

Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
2023-05-02 17:56:35 -05:00
..
complete.rs Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00
exec.rs Add --redirect-combine option to run-external (#8918) 2023-04-28 07:55:48 -05:00
mod.rs relocate debug commands (#8071) 2023-02-13 16:39:07 +00:00
nu_check.rs Only add the std lib files once (#8830) 2023-04-10 08:55:47 +12:00
ps.rs Add ppid example for ps (#8768) 2023-04-06 07:32:12 -05:00
registry_query.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
run_external.rs Don't run .sh files with /bin/sh (#8951) 2023-05-02 17:56:35 -05:00
sys.rs Fix CPU usage info in sys (#8321) 2023-03-04 14:48:34 -08:00
which_.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00