DEV Community

Discussion on: How to run copied CLI commands with a leading "$" sign

Collapse
unixorn profile image
Joe Block

If you make it exec $@, then your $ script will replace itself with the command, which will make it return the same exit code as the command you ran with it.

Your implementation will always exit 0 and suppress any exit code from what it runs, causing other scripts to think that things succeeded even when they fail.

Collapse
stefanjudis profile image
Stefan Judis Author • Edited

That's great feedback. Thanks Joe, I'll update and edit the post!