Bonjour a vous,
Je fais joujou avec la commande su sous dragonfly BSD et je trouve que le man de su est bizarre.
tout d'abors l'aide interne de su:
- su -help
su: illegal option -- h
usage: su [-] [-flm] [-c class] [login [args]]
l'option -c correspond ici a une class et pas a une commande comme sous linux.
On peut en effet lire dans le man :
-c class
Use the settings of the specified login class. Only allowed for
the super-user.
Mais alors les exemple fournit dans cette meme page de manuel sont ENCORE plus etrange:
su -m man -c catman
Runs the command catman as user man. You will be asked for man's
password unless your real UID is 0. Note that the -m option is
required since user ``man does not have a valid shell by
default.
su -m man -c 'catman /usr/share/man /usr/local/man /usr/pkg/xorg/man'
Same as above, but the target command consists of more than a sin-
gle word and hence is quoted for use with the -c option being
passed to the shell. (Most shells expect the argument to -c to be
a single word).
su -m -c staff man -c 'catman /usr/share/man /usr/local/man
/usr/pkg/xorg/man'
Same as above, but the target command is run with the resource
limits of the login class ``staff. Note: in this example, the
first -c option applies to su while the second is an argument to
the shell being invoked.
Donc, si j'ecoute le manuel et l'option en ligne, l'option -c sert juste pour des problemes de "droits d'acces". Mais si j'en crois les exemples ca sert aussi a executer une commande (comme sous debian). Sachant qu'en pratique ca a l'air de marcher comme sous debian:
- su erik -c 'ls /home'
data erik snapshots
Un avis ?