Turbo Fredriksson

Results 51 comments of Turbo Fredriksson

Because I'm using bourne shell, It shouldn't tell me about the "Assign as array" (because the're not available).

my_function /bin/ls "${ARGS[@]}": ``` In /tmp/tst.sh line 11: my_function /bin/ls "${ARGS[@]}" ^-- SC2039: #!/bin/sh was specified, but array references are not standard. ```

Sorry, that was in the wrong place, wrong example. But still. No arrays in bourne shell.

@lucy That still is quoted and will be treated as ONE option, not FOUR… It passes the shellcheck tests though. But it's wrong programmatically...

@izabera That might work in this simple example, but I have a couple of _real_ code where it's required to do it this way. I really don't want one separate...

@lucy and that's your problem. It should print: ``` # /tmp/tst.sh -p pid arg1 arg2 arg3 ``` As I've said, if you quote $@, it will be treated as ONE...

No, hang on… Something is amiss here. @izabera Yes, you're right… I need to look at this some more.

That exact code (new cut-and-paste!) will give me the output I gave...

However, there's a difference here…@lucy is here calling my_function() with each option as separate. I'm calling them as one string.

Even if I use /bin/dash, I still get one option per line (if not quoting the args).