#!/bin/bash[[$# -ne 1]]&&echo"Please give a folder"&&exit 1
FOLDER=1ドル[[ ! -d ${FOLDER}]]&&echo"${FOLDER} is not a folder"&&exit 1
PERM=$(stat -c %a ${FOLDER})if[[${#PERM} -eq 4]]&&[[${PERM:0:1} -eq 2]];thenecho"New file in ${FOLDER} will have owner : $(id -un), group $(stat -c %G ${FOLDER})"elseecho"New file in ${FOLDER} will have owner : $(id -un), group $(id -gn)"fi
(copyright moi, il y a d'autre méthode je te laisse ne pas copier coller le script bêtement)
Is it a Bird? Is it a Plane?? No, it's Super Poil !!!
[^] # Re: commandes who, grep, cut, ...
Posté par M.Poil (site web personnel) . En réponse au message Connaître l'utilisateur et le groupe qui seront automatiquement propriétaires de nouveaux fichiers. Évalué à 3. Dernière modification le 08 novembre 2015 à 20:09.
Bah euh moi en 3 minutes je ferai :
(copyright moi, il y a d'autre méthode je te laisse ne pas copier coller le script bêtement)
Is it a Bird? Is it a Plane?? No, it's Super Poil !!!