Autodesk-Fusion-360-for-Linux
Autodesk-Fusion-360-for-Linux copied to clipboard
Shell command executed differently in a terminal and script!
I may have found another reason for the different results, why the installation works for one and not for the other.
If you look at the examples and explanation in the page linked below, you can see why.
So please check it out: https://unix.stackexchange.com/questions/464770/shell-command-executed-differently-in-a-terminal-and-script
Worth looking into https://github.com/koalaman/shellcheck .
You could also set this up for CI on each PR using GitHub Actions/workflows to ensure that all accepted code contributions are properly portable across shells, and therefore (hopefully) portable across distros.
^
https://github.com/marketplace/actions/run-shellcheck-with-reviewdog
and/or
https://github.com/marketplace/actions/shellcheck
But... which one does and which one doesn't it work in?
This shouldn't be an issue, the terminal and the launcher should be respecting the shebang (#!/bin/bash
) at the beginning of the files. However, I just learned that when using source
to launch a script, some shells (zsh
mainly) don't.
This answer is more likely to provide more explanation: https://unix.stackexchange.com/questions/580124/does-zsh-respect-the-shebang-bin-sh-so-dash-can-be-used
I think that if we want to use bash, the launch command line should be changed to bash ./install.sh
instead of ./install.sh
.