Typical of sh shells is to have a -c flag that takes all the remainder arguments as a command. This allows for stuff like bash -l -c foo "$@" to work and splat the arguments properly, including strings with spaces.
Fish does not do this:
$ fish -l -c ls -1
fish: invalid option -- 1
$ fish -l -c "ls -1"
foo
bar
baz
While this allows to put -c anywhere as an argument, this isn't quite as useful as passing actual arguments to the command to run within fish.
Typical of
shshells is to have a-cflag that takes all the remainder arguments as a command. This allows for stuff likebash -l -c foo "$@"to work and splat the arguments properly, including strings with spaces.Fish does not do this:
While this allows to put
-canywhere as an argument, this isn't quite as useful as passing actual arguments to the command to run within fish.