Anonymous
public shellscript v1 · immutable[root@worm ~]# cat MainProgram.sh#!/bin/shExecute (){ echo -e "Executing $@ ..."; $@;}Execute "./getopts.sh -P 'hello world'"./getopts.sh -P 'hello world'[root@worm ~]# cat getopts.sh#!/bin/shwhile getopts "P:" ido case "$i" in P) VAR="$OPTARG"; continue;; *) echo $usage; exit 1;; esacdoneecho $VAR[root@worm ~]# ./MainProgram.shExecuting ./getopts.sh -P 'hello world' ...'hellohello world