Skip to content

Conversation

@offby1
Copy link
Contributor

@offby1 offby1 commented Oct 15, 2024

Just a sentence suggesting people use shell instead of backticks.

Oh look, I just used backticks up there!! :-)

@laniakea64
Copy link
Contributor

laniakea64 commented Oct 15, 2024

Why deprecate?

Backticks are still useful for concisely expressing simple, fixed (i.e. not just expressions) commands. Using shell() where a backtick can do the job doesn't address any potentially-unexpected behavior and doesn't add clarity.

Also, backticks are not equivalent to shell():

backtick := `echo "$0" "$@"`
shell := shell('echo "$0" "$@"')
$ just --evaluate
backtick := "sh"
shell    := "echo "$0" "$@""

Mentioning shell() in this part of the README seems reasonable to me, but maybe better along the lines of "More flexible and more powerful command invocations can be achieved with the shell() function" and written at the end of the section

@casey casey enabled auto-merge (squash) October 30, 2024 22:28
@casey casey merged commit b063940 into casey:master Oct 30, 2024
@casey
Copy link
Owner

casey commented Oct 30, 2024

Nice, merged! Yah, unlike in shell scripts, backticks in just don't have any weird behaviors, so no need to deprecated them. The note is nice though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants