10-10-2007
#!/bin/bash
if [ $# -eq "0" ]
then
# this prints the usage if no arguments are received.
echo "usage: `basename $0` <user>"
exit
fi
# check if username provided to script is a valid user
if [ `grep -i ^$1: /etc/passwd` ]
then
mkdir /users/$1
mkdir /users/$1/chess
chown -R $1:users /users/$1
else
echo user $1 not found
fi
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
What I am supposed to do is creat a menu with the following
Find a song
Find a album
Sort by artist
Delete a song
Add a new song
Quit
Now the file with the song information is database
Here is what I have so far
#!/bin/bash
#=================================================
#Script Name:... (1 Reply)
Discussion started by: stp0052
1 Replies
2. Shell Programming and Scripting
a) Total number of words in the file.
b) Total number of different words in the file.
How can I use the translate and/or unique commands to accomplish this (4 Replies)
Discussion started by: EECSDAVE
4 Replies
3. Shell Programming and Scripting
Hi everybody :( :confused: :D,
I need someone to help me! I have a file with 4 colunms and I would like to transform only the 4th colunm by multiplying this by a constant value (i.e 0.3047). I'm a new one using/creating basic scripts and I'm using linux redhat.
The file has the following... (1 Reply)
Discussion started by: Estanislau
1 Replies
4. Shell Programming and Scripting
Hi everybody :( :confused: :D,
I need someone to help me! I have a file with 4 colunms and I would like to transform only the 4th colunm by multiplying this by a constant value (i.e 0.3047). I'm a new one using/creating basic scripts and I'm using linux redhat.
The file has the following... (1 Reply)
Discussion started by: Estanislau
1 Replies
5. Shell Programming and Scripting
I'm trying to approach a problem but all I'm coming up with are complex ways to manipulate the data. But still not getting the desired outcome.
directory of files....
file-100-foo
file-100-man
file-100-chu
Need to copy the files and increment the number in the file name
... (4 Replies)
Discussion started by: suphawk
4 Replies
6. Shell Programming and Scripting
Im trying to make a script that simply adds a word to the last available line in a txt file without overwriting any previous lines.
Ive googled this and there are great examples but no one explain what each function does, and i dont entirely understand how it works.
Basically Im looking for... (7 Replies)
Discussion started by: kylecn
7 Replies
7. UNIX for Dummies Questions & Answers
Here is the script I wrote... Pls. help.
#!/bin/ksh
for SERVER in
NEWSNYD403P
NEWSNYD404P
SNEWSNYD601P
SNEWSNYD602P
SNEWSDNY603P
SNEWSNYD604P
do
/usr/bin/scp "/home/sam/bash.tar root@$SERVER":/tmp
done
Error msg I get:
./scp_script.sh: syntax error at line 3:... (2 Replies)
Discussion started by: samnyc
2 Replies
8. Shell Programming and Scripting
Hey everyone, just now joined because I didn't want to go onto Ubuntu forums and start asking about how to write shell scripts. Seems like this is a pretty active forum for exactly what I need.
I'm trying to modify a shell script I found online, the end goal is to have it find all files in the... (9 Replies)
Discussion started by: mozzles
9 Replies
LEARN ABOUT DEBIAN
sss_useradd
SSS_USERADD(8) SSSD Manual pages SSS_USERADD(8)
NAME
sss_useradd - create a new user
SYNOPSIS
sss_useradd [options] LOGIN
DESCRIPTION
sss_useradd creates a new user account using the values specified on the command line plus the default values from the system.
OPTIONS
-u,--uid UID
Set the UID of the user to the value of UID. If not given, it is chosen automatically.
-c,--gecos COMMENT
Any text string describing the user. Often used as the field for the user's full name.
-h,--home HOME_DIR
The home directory of the user account. The default is to append the LOGIN name to /home and use that as the home directory. The base
that is prepended before LOGIN is tunable with "user_defaults/baseDirectory" setting in sssd.conf.
-s,--shell SHELL
The user's login shell. The default is currently /bin/bash. The default can be changed with "user_defaults/defaultShell" setting in
sssd.conf.
-G,--groups GROUPS
A list of existing groups this user is also a member of.
-m,--create-home
Create the user's home directory if it does not exist. The files and directories contained in the skeleton directory (which can be
defined with the -k option or in the config file) will be copied to the home directory.
-M,--no-create-home
Do not create the user's home directory. Overrides configuration settings.
-k,--skel SKELDIR
The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is
created by sss_useradd.
This option is only valid if the -m (or --create-home) option is specified, or creation of home directories is set to TRUE in the
configuration.
-Z,--selinux-user SELINUX_USER
The SELinux user for the user's login. If not specified, the system default will be used.
-h,--help
Display help message and exit.
THE LOCAL DOMAIN
In order to function correctly, a domain with "id_provider=local" must be created and the SSSD must be running.
The administrator might want to use the SSSD local users instead of traditional UNIX users in cases where the group nesting (see
sss_groupadd(8)) is needed. The local users are also useful for testing and development of the SSSD without having to deploy a full remote
server. The sss_user* and sss_group* tools use a local LDB storage to store users and groups.
SEE ALSO
sss_groupadd(8), sss_groupdel(8), sss_groupshow(8), sss_groupmod(8), sss_userdel(8), sss_usermod(8).
AUTHORS
The SSSD upstream - http://fedorahosted.org/sssd
SSSD
03/04/2013 SSS_USERADD(8)