Sponsored Content
Full Discussion: Basic script?
Top Forums Shell Programming and Scripting Basic script? Post 302140075 by synak on Wednesday 10th of October 2007 03:22:41 PM
Old 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

Need help with basic unix script

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

I need help with a basic script

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

create a basic script

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

create a basic script

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

Basic script question

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

Basic shell script help

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

Help with basic script - not working..

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

Need a little help with my first shell script. Basic image resize script...

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
cvsd-buildroot(8)					      System Manager's Manual						 cvsd-buildroot(8)

NAME
cvsd-buildroot - create a chrooted directory structure for use in cvsd. SYNOPSIS
cvsd-buildroot DIRECTORY DESCRIPTION
cvsd-buildroot creates and populates a directory that can be used as a chroot jail for running cvsd (see cvsd(8) ) in. This script should be run as the root user since the creation of devices and the changing of ownership and permissions require this. The script gives warnings about files that it's not expecting. cvsd-buildroot creates the following directory structure: /bin This directory is populated with the cvs binary that is found on the system. /lib This directory is populated with all the libraries that are required for running programs in the /bin directory as well as some predefined required libraries that are present on the system. /dev Here null and zero devices are created. /etc In this directory a passwd file is created that is used for matching user id's with usernames. The root and cvsd user are added to this file if they're not there yet. The passwd file is checked for consistency with the system /etc/passwd to prevent mistakes. The passwd file is also populated with users referenced in the repository directories. Note that no password data from /etc/passwd or any other file is stored in the generated passwd file, all password entries are set to 'x'. /usr Here symbolic links are placed to /bin and /lib for some common library and binary directories found on the system. This is done for systems that have hard-coded paths for libraries. /libexec and /usr/libexec Symbolic links for these directories are created if they are present on the system. /tmp This directory is cleaned out on systems that have tmpreaper. After the directories are created and populated ownership and rights are set to a reasonable value (root:root,umask=022). OPTIONS
cvsd-buildroot takes one argument, namely a directory in which the chroot jail will be created. The directory should be specified with an absolute path. NOTES
Creating a chroot environment is a terribly non-portable thing to do and therefore you may experience problems with missing libraries and system files. For more information see the FAQ and the README. If you have to install libraries or perform actions not covered by cvsd-buildroot please report your findings to <cvsd-users@lists.arthurdejong.org>. Rerunning cvsd-buildroot after you have created your repository is advised since the repositories are checked for references to userid's and lockfile directories. SEE ALSO
cvsd(8) README FAQ AUTHOR
Arthur de Jong <arthur@arthurdejong.org>. Version 1.0.24 Jun 2012 cvsd-buildroot(8)
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy