Files
RedBear-OS/recipes/shells/bash/source/tests/getopts.right
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

69 lines
1.5 KiB
Plaintext

getopts: usage: getopts optstring name [arg ...]
2
getopts: usage: getopts optstring name [arg ...]
2
./getopts.tests: line 23: getopts: -a: invalid option
getopts: usage: getopts optstring name [arg ...]
-a specified
-b bval specified
remaining args: one two three
-a specified
-b bval specified
remaining args: one two three four five six seven eight nine ten eleven twelve
./getopts1.sub: option requires an argument -- b
Usage: ./getopts1.sub [-a] [-b value] args
-a specified
-c cval specified
-d specified
-a specified
-b 3 specified
remaining args: one two three four five
-a specified
-b bval specified
remaining args: one two three
-a specified
-b bval specified
remaining args: one two three
./getopts4.sub: error: option `b' requires an argument
Usage: ./getopts4.sub [-a] [-b value] args
./getopts4.sub: error: illegal option character `c'
Usage: ./getopts4.sub [-a] [-b value] args
-a specified
remaining args: -b bval one two three
OPTERR=0
a here
something else here
OPTIND=3
getop: OPTERR=1
a here
./getopts5.sub: illegal option -- c
something else here
./getopts5.sub: illegal option -- d
something else here
./getopts5.sub: illegal option -- e
something else here
getop: OPTIND=5
OPTIND=3
OPTERR=0
-a specified
remaining args:
-a specified
remaining args:
-a specified
remaining args:
0
./getopts7.sub: line 17: getopts: `opt-var': not a valid identifier
remaining args:
opt: x
opt: y
opt: a
opt: b
opt: c
opt: z
$1 = a
./getopts10.sub: line 16: OPTARG: readonly variable
OPTARG = x = ?
unset x = ?
declare -r RO="foo"
declare -r RO="foo"