Maneage - Tasks: task #15996, bash options: -u and -o pipefail
You are not allowed to post comments on this tracker with your current authentication level.
task #15996: bash options: -u and -o pipefail
Submitter: | Boud Roukema <boud> | ||
Submitted: | Thu 24 Jun 2021 08:33:20 PM UTC | ||
Should Start On: | Thu 24 Jun 2021 12:00:00 AM UTC | Should be Finished on: | Thu 24 Jun 2021 12:00:00 AM UTC |
Category: | None | Priority: | 5 - Normal |
Status: | None | Privacy: | Public |
Percent Complete: | 0% | Assigned to: | None |
Open/Closed: | Open | Effort: | 0.00 |
Sat 26 Jun 2021 12:48:05 AM UTC, comment #4: |
Boud Roukema <boud>![]() |
Fri 25 Jun 2021 11:01:49 PM UTC, comment #3: It is a good suggestion to add these flags, they are indeed very useful (and if someone doesn't like them, they can easily be dis-activated).
|
Mohammad Akhlaghi <makhlaghi>![]() |
Fri 25 Jun 2021 08:43:48 PM UTC, comment #2: See https://savannah.nongnu.org/task/index.php?15997 for safe-rm , an alternative to set -u for reducing the chance of a catastrophic rm event.
|
Boud Roukema <boud>![]() |
Fri 25 Jun 2021 08:27:30 PM UTC, comment #1: The link failed in 'full markup', so here it is again: https://octodon.social/@eptf/105080666953522366 |
Boud Roukema <boud>![]() |
Thu 24 Jun 2021 08:33:20 PM UTC, original submission:
The command help set shows two potentially very useful bash options for reducing the chance of catastrophic errors (recursive remove due to an "unbound" (undefined) environment variable) and for failing a pipe if any of the pipe elements fails, rather than continuing on happily despite the error. There's a very nice explanatory cartoon at [1].
|
Boud Roukema <boud>![]() |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
If I have the time to look at this in depth, I'll create a branch, but the task is open to any other volunteers... My impression was that there could be quite a few cases to handle beyond LIBS in cmake.
Dash appears to have -u , from 'info dash':
but doesn't seem to have -o pipefail .
So -u should be usable for basic.mk - but obviously will have to be tested properly first.