.Dd February 24, 2019 .Dt SETOPT 1 .Os . .Sh NAME .Nm setopt .Nd parse command options . .Sh SYNOPSIS .Nm .Ar optstring .Op Ar args ... . .Sh DESCRIPTION .Nm behaves similarly to .Xr getopt 1 , except that it produces quoted output appropriate for use with the .Nm eval shell builtin. This allows arguments containing whitespace to survive parsing. . .Sh EXAMPLES .Bd -literal -offset indent args=$(setopt abo: "$@") eval set -- "$args" .Ed . .Sh SEE ALSO .Xr getopt 1 , .Xr sh 1 , .Xr getopt 3 . .Sh HISTORY The .Xr getopt 1 manual page of .Fx reads, .Do Arguments containing white space or embedded shell metacharacters generally will not survive intact; this looks easy to fix but isn't. .Dc Yet here we are.