3 #=======================================================================
5 # File ID: cbdb01c6-63be-11e5-84b6-fefdb24f8e10
7 # Create a directory using sudo(8) where the current user don't have
8 # permission to do so, and set the owner of that directory to the
11 # Author: Øyvind A. Holm <sunny@sunbase.org>
12 # License: GNU General Public License version 2 or later.
13 #=======================================================================
27 " -n "$progname" -- "$@
")"
28 test "$?" = "0" ||
exit 1
36 -h|
--help) opt_help
=1; shift ;;
37 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
38 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
39 --version) echo $progname $VERSION; exit 0 ;;
41 *) echo $progname: Internal error
>&2; exit 1 ;;
44 opt_verbose
=$
(($opt_verbose - $opt_quiet))
46 if test "$opt_help" = "1"; then
47 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
50 Create a directory using sudo(8) where the current user don't have
51 permission to do so, and set the owner of that directory to the current
54 Usage: $progname [options] DIRECTORY
61 Be more quiet. Can be repeated to increase silence.
63 Increase level of verbosity. Can be repeated.
65 Print version information.
73 if test "$user" = "root"; then
74 echo $progname: You are root
, should be run as a regular user
79 sudo chown
-v "$user".
"$user" "$1"