Ticket #3 (defect)
Opened 1 year ago
Last modified 1 year ago
printf with leading "--" has problems on some systems/shells
Status: closed (fixed)
| Reported by: | gary | Assigned to: | apokayi |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | |
| Keywords: | guts | Cc: | |
On some shells, printf is built in, and has different syntax rules than the system printf command. For example,
sh-3.1$ printf "---- now is the -- time\n" sh: printf: --: invalid option printf: usage: printf [-v var] format [arguments] sh-3.1$ /usr/bin/printf "---- now is the -- time\n" ---- now is the -- time
We fixed the problem here by using echo instead of printf, but I think two leading dashes will do the trick as well?
95c95 < printf "--------------> Working on unit -- $NUNIT\n" --- > echo "--------------> Working on unit -- $NUNIT\n" 130c130 < printf "--------------> Working on unit -- $RNUNIT\n" --- > echo "--------------> Working on unit -- $RNUNIT\n"
Change History
09/06/07 16:26:11: Modified by sbahra
- owner changed from somebody to apokayi.
- description changed.
09/20/07 04:55:59: Modified by apokayi
- status changed from new to closed.
- resolution set to fixed.

printf is changed to echo for lines 95 and 130 to avoid conflictions