Sponsored Content
Homework and Emergencies Homework & Coursework Questions Linux/UNIX Bash Shell Script trouble help needed!! Post 302791923 by TomFord1 on Tuesday 9th of April 2013 01:12:38 PM
Old 04-09-2013
Linux/UNIX Bash Shell Script trouble help needed!!

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!




[b]2. Shell Bash Script



[b]3.

Code:
 !/bin/bash
if [ ! -d /home/AC_Drywall]
   echo no directory 
then 
	mkdir -p /home/AC_Drywall
elif [ ! -d ]; then
   echo "$dir already exist"
fi


[b]4. Gwinnett Tech College / CIST 1520 Scripting Technologies / Shane Archibald


Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

I'm totally lost on what the code suppose to look like on this project:

The Antonio Czechos Drywall Firm has hired you to help implement a directory structure for them based on Figure 5-19. Because you were called out of town to aid another customer, you cannot go to the site. In the meantime, you decide to write a script that will create the structure for them. To create the directory structure, complete the following tasks:

Helllllllllllllllllllllllp!!! Smilie

---------- Post updated at 01:12 PM ---------- Previous update was at 12:42 PM ----------

So this the code I wrote completely but i believe it's wrong

Code:
!/bin/bash
if [ ! -d /home/AC_Drywall]
then
   echo no directory 
then 
	mkdir -p /home/AC_Drywall
elif [ ! -d ]; then
   echo "$dir already exist"
fi   
if [ ! -d /home/AC_Drywall/MIS/Production/Marketing]
then
	echo no directory
then
	mkdir -p /home/AC_Drywall/MIS/Production/Marketing
elif [ ! -d ]; then
	echo "dir already exist"
fi
if [ ! -d /home/AC_Drywall/MIS/Project1/work1.doc/work2.doc]
then
	echo no directory
then
	mkdir -p /home/AC_Drywall/MIS/Project1/work1.doc/work2.doc
elif [ ! -d ]; then
	echo "dir already exist"
fi
if [ ! -d /home/AC_Drywall/Production/Shift1/Shift2/Shift3]
then
	echo no directory
then
	mkdir -p /home/AC_Drywall/Production/Shift1/Shift2/Shift3
elif [ ! -d ]; then
	echo "dir already exist"
fi
if [ ! -d /home/AC_Drywall/Production/Shift1/.manager1.txt/emp1.txt]	
then
	echo no directory
then
	mkdir -p /home/AC_Drywall/Production/Shift1/.manager1.txt/emp1.txt
elif [ ! -d ]; then
	echo "dir already exist"
fi
if [ ! -d /home/AC_Drywall/Marketing/Sales/Admin]
then
	echo no directory
then
	mkdir -p /home/AC_Drywall/Marketing/Sales/Admin
elif [ ! -d ]; then
	echo "dir already exist"
fi
if [ ! -d /home/AC_Drywall/Marketing/Sales/East/West]
then
	echo no directory
then
	mkdir -p /home/AC_Drywall/Marketing/Sales/East/West
elif [ ! -d ]; then
	echo "dir already exist"
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash Script: Trouble unable to run

I am trying to create a menu, and the script fails on ln 38 (Files in pwd). Any idea on where the problem is?? Thanks for the help Rob #!/bin/bash # Cool Script for Weekly Assignment 2 (#3) that creates a menu to act as a ui # and run some popular commands. clear while : do ... (9 Replies)
Discussion started by: rchirico
9 Replies

2. Shell Programming and Scripting

Quoting issue: Trouble with bash strings in script

I can do this on the command line: sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\ select second_id from borrower where btype like '%wsd%' " I can also just leave the SQL at the end intact on one line .... ... However, when I throw this in a script like: $SQSH -o... (4 Replies)
Discussion started by: Bubnoff
4 Replies

3. Shell Programming and Scripting

Help with Unix bash shell script login

Hi, I am a complete Unix novice and need some help with creating a login shell script. I have created a file with user details i.e. PIN, name etc and require help in recalling the specified details from the file and being prompted for a password on login. Any help would be very much appreciated.... (0 Replies)
Discussion started by: tdsrogers
0 Replies

4. Shell Programming and Scripting

rm:command not found in linux Bash shell script

Hi All, Linux lxs3er06 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux Issue: While executing shell scripts in bash shell, following error messages are thrown: rm:command not found On doing little investigation, I added '/bin' to $PATH and on doing echo... (9 Replies)
Discussion started by: a1_win
9 Replies

5. Homework & Coursework Questions

unix script trouble

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi I am new to unix and need some help, the main reason I am here is because i need basic unix knowledge The... (2 Replies)
Discussion started by: krolike
2 Replies

6. Shell Programming and Scripting

PLEASE HELP! LINUX BASH SHELL SCRIPT

PLEASE HELP! NEED LINUX SCTIPT Need to write a bash shell script to show information of employees of a department from a company data set. The script should accept a project number (1/2/3/10/20/30) and output * the name of the project * the name of the manager of the controlling... (1 Reply)
Discussion started by: help123
1 Replies

7. Homework & Coursework Questions

LINUX Bash Shell Script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a bash shell script that presents work information of employees of a department from a company data... (1 Reply)
Discussion started by: help123
1 Replies

8. Shell Programming and Scripting

Having trouble with My Bash Script, need Help debugging

Hello Friends I am having trouble with my script below. I will describe the problems below the code box. I am hoping that some of the experts here can help me. #!/bin/bash #========================================================================================================= # Rsync File... (8 Replies)
Discussion started by: jdavis_33
8 Replies

9. Shell Programming and Scripting

Linux/bash Script only working if executed from shell prompt

Hi, maybe I'm asking a VERY dumb question, but would anybody out there tell me, why this f****** script won't work if executed as a cronjob, but works fine if executed from a shell prompt? #! /bin/bash set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin date >>... (3 Replies)
Discussion started by: beislhur
3 Replies

10. Shell Programming and Scripting

UNIX Korn Shell to Linux Bash

Migrating Unix batch jobs (Korn Shell) running in HP-UX server to Linux environment. Hi All Please help me to understand the easiest way to migrate Kernel Shell scripts to Linux Bash. Also let me know 1. Any automated scripts or tools available for this. 2. Challenges and issues... (5 Replies)
Discussion started by: cpremesh
5 Replies
pure-authd(8)							     Pure-FTPd							     pure-authd(8)

NAME
pure-authd - External authentication agent for Pure-FTPd. SYNTAX
pure-authd [-p </path/to/pidfile>] [-u uid] [-g gid] [-B] <-s /path/to/socket> -r /program/to/run DESCRIPTION
pure-authd is a daemon that forks an authentication program, waits for an authentication reply, and feed them to an application server. pure-authd listens to a local Unix socket. A new connection to that socket should feed pure-authd the following structure : account:xxx password:xxx localhost:xxx localport:xxx peer:xxx end (replace xxx with appropriate values) . localhost, localport and peer are numeric IP addresses and ports. peer is the IP address of the remote client. These arguments are passed to the authentication program, as environment variables : AUTHD_ACCOUNT AUTHD_PASSWORD AUTHD_LOCAL_IP AUTHD_LOCAL_PORT AUTHD_REMOTE_IP AUTHD_ENCRYPTED The authentication program should take appropriate actions to fetch account info according to these arguments, and reply to the standard output a structure like the following one : auth_ok:1 uid:42 gid:21 dir:/home/j end auth_ok:xxx If xxx is 0, the user was not found (the next authentication method passed to pure-ftpd will be tried) . If xxx is -1, the user was found, but there was a fatal authentication error : user is root, password is wrong, account has expired, etc (next authentication methods will not be tried) . If xxx is 1, the user was found and successfully authenticated. uid:xxx The system uid to be assigned to that user. Must be > 0. gid:xxx The primary system gid. Must be > 0. dir:xxx The absolute path to the home directory. Can contain /./ for a chroot jail. slow_tilde_expansion:xxx (optional, default is 1) When the command 'cd ~user' is issued, it's handy to go to that user's home directory, as expected in a shell environment. But fetching account info can be an expensive operation for non-system accounts. If xxx is 0, 'cd ~user' will expand to the system user home directory. If xxx is 1, 'cd ~user' won't expand. You should use 1 in most cases with external authentication, when your FTP users don't match system users. You can also set xxx to 1 if you're using slow nss_* system authentication modules. throttling_bandwidth_ul:xxx (optional) The allocated bandwidth for uploads, in bytes per second. throttling_bandwidth_dl:xxx (optional) The allocated bandwidth for downloads, in bytes per second. user_quota_size:xxx (optional) The maximal total size for this account, in bytes. user_quota_files:xxx (optional) The maximal number of files for this account. ratio_upload:xxx (optional) radio_download:xxx (optional) The user must match a ratio_upload:ratio_download ratio. Only one authentication program is forked at a time. It must return quickly. OPTIONS
-u <uid> Have the daemon run with that uid. -g <gid> Have the daemon run with that gid. -B Fork in background (daemonization). -s </path/to/socket> Set the full path to the local Unix socket. -R </path/to/program> Set the full path to the authentication program. -h Output help information and exit. EXAMPLES
To run this program the standard way type: pure-authd -s /var/run/ftpd.sock -r /usr/bin/my-auth-program & pure-ftpd -lextauth:/var/run/ftpd.sock & /usr/bin/my-auth-program can be as simple as : #! /bin/sh echo 'auth_ok:1' echo 'uid:42' echo 'gid:21' echo 'dir:/home/j' echo 'end' AUTHORS
Frank DENIS <j at pureftpd dot org> SEE ALSO
ftp(1), pure-ftpd(8) pure-ftpwho(8) pure-mrtginfo(8) pure-uploadscript(8) pure-statsdecode(8) pure-pw(8) pure-quotacheck(8) pure-authd(8) RFC 959, RFC 2389, RFC 2228 and RFC 2428. Pure-FTPd team 1.0.36 pure-authd(8)
All times are GMT -4. The time now is 10:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy