PX4 / PX4-Devguide

PX4 Devguide GitBook
http://dev.px4.io
Other
196 stars 481 forks source link

Fix shell script typo in 'Adding a new airframe' #1131

Closed mortenfyhn closed 3 years ago

mortenfyhn commented 3 years ago

Just noticed this when reading. Using == works with bash, but not with sh.

By the way, the "edit page" button leading to automatically creating a fork and letting me suggest changes is very sleek!

hamishwillee commented 3 years ago

Thanks @mortenfyhn . Can you confirm the change works with both bash and sh?

Glad you like the edit button. FYI next week the devguide should merge into the user guide. At that point the edit link will do same thing, but is at end of the page - see the test tree here: https://docs.px4.io/v1.devmerge/en/dev_setup/getting_started.html

mortenfyhn commented 3 years ago

Sure, I can confirm that this script:

AUTOCNF="yes"
if [ $AUTOCNF == yes ]
then
    echo "yes"
fi

runs fine with bash script.sh but fails with sh script.sh, error script.sh: 2: [: yes: unexpected operator

While this script:

AUTOCNF="yes"
if [ $AUTOCNF = yes ]
then
    echo "yes"
fi

runs properly with both bash and sh.

hamishwillee commented 3 years ago

Thanks very much @mortenfyhn - merged. FYI I hope to merge devguide into user guide in next couple of days. This has been manually copied across.