| Summary: | The "-n" in "echo -n foo > /sys/bar" is not posix and not needed | ||
|---|---|---|---|
| Product: | pm-utils | Reporter: | Alexandre Rostovtsev <tetromino> |
| Component: | General | Assignee: | Richard Hughes <richard> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | medium | CC: | fieldhouse, freedesktop-bugs |
| Version: | unspecified | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: |
proposed patch
patch based on review of patch 117432 taken from running pm-functions |
||
|
Description
Alexandre Rostovtsev
2015-07-29 02:23:38 UTC
Created attachment 117432 [details] [review] proposed patch Rather than changing all these, consider adding a shell function as follows:
echo()
{
local fmt='%s\n'
[ "$1" = "-n" ] && { fmt='%s'; shift; }
printf "$fmt" "$*"
}
You can then redefine the existing log() function (line 90):
log()
{
is_set "$LOGGING" || return 0;
echo $*
}
This will (a) work on all platforms where log() now works (b) support use of "echo -n" in the code in case future contributors should introduce any.
Created attachment 122011 [details]
patch based on review of patch 117432 taken from running pm-functions
pm-utils hasn't been touched in eight years, none of this is likely to get addressed. Closing bugs and disabling the bz product. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.