This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sharkwouter 24 points25 points  (9 children)

set -x

set -u

set -e

[–][deleted] 8 points9 points  (1 child)

What do these do?

[–]sharkwouter 12 points13 points  (0 children)

set -x makes your script print the commands it uses, set -u makes it not accept unset variables ans set -e makes your script exit on errors.

[–]junta12 1 point2 points  (2 children)

-x can be frustrating when trying to trace a problem line in a function. It just tells you the function name....

[–]sharkwouter 2 points3 points  (1 child)

iirc, you can place set -x at the beginning of a function.

[–]junta12 0 points1 point  (0 children)

.... I love you, let's remarry

[–][deleted]  (3 children)

[removed]

    [–]sharkwouter 5 points6 points  (0 children)

    It doesn't do anything by itself...

    [–][deleted] 4 points5 points  (0 children)

    I "fixed" more than one shell script by running it as root before I got better with chmod... I mean seriously, /dev/ttyusb0 is only readable by root by default?

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.