[CentOS] Slightly OT: check creation of a group
m.roth at 5-cent.us
m.roth at 5-cent.usMon Mar 1 16:22:05 UTC 2010
- Previous message: [CentOS] Slightly OT: check creation of a group
- Next message: [CentOS] issues with 3rd party repos for centos
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Niki wrote:
>
> I'm currently writing an install script for an application, and my
> already limited Bash skills are a bit rusty.
>
> I want to check if a group exists, and if it doesn't, then create it.
>
> Only thing I found is:
>
> if [ grep medintux /etc/group ]; then
> continue
> else
> groupadd medintux
> fi
>
Why not
if [ `grep -c medintux /etc/group` == 0 ]; then
groupadd medintux
fi
?
mark
- Previous message: [CentOS] Slightly OT: check creation of a group
- Next message: [CentOS] issues with 3rd party repos for centos
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list