View Issue Details

IDProjectCategoryView StatusLast Update
00014421003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2024-06-11 09:08
Reporterandras_farkas Assigned To 
PrioritynormalSeverityCommentTypeEnhancement Request
Status ClosedResolutionAccepted 
NameAndras Farkas
Organization
User Reference
Sectiongetopts
Page Number2840
Line Number93538 and 93541
Interp Status---
Final Accepted Text
Summary0001442: Improvement to getopts example, remove double negation
DescriptionOn getopts's page
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html
The example uses interesting double negation in the two tests:
if [ ! -z "$aflag" ]; then
if [ ! -z "$bflag" ]; then
! -z could be shortened to -n
Desired ActionReplace
if [ ! -z "$aflag" ]; then
with
if [ -n "$aflag" ]; then
and
if [ ! -z "$bflag" ]; then
with
if [ -n "$bflag" ]; then
Tagstc3-2008

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-01-10 13:10 andras_farkas New Issue
2021-01-10 13:10 andras_farkas Name => Andras Farkas
2021-01-10 13:10 andras_farkas Section => getopts
2021-01-10 22:42 Don Cragun Page Number => 2840
2021-01-10 22:42 Don Cragun Line Number => 93538 and 93541
2021-01-10 22:42 Don Cragun Interp Status => ---
2021-10-28 15:48 Don Cragun Status New => Resolved
2021-10-28 15:48 Don Cragun Resolution Open => Accepted
2021-10-28 15:48 Don Cragun Tag Attached: tc3-2008
2021-11-25 16:08 geoffclare Status Resolved => Applied
2024-06-11 09:08 agadmin Status Applied => Closed