School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,014 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,059 people online right now. Registration is fast and FREE... Join Now!




Unix Project

 

Unix Project, Unix Project Scripting

deven1974

3 Oct, 2009 - 06:09 AM
Post #1

New D.I.C Head
*

Joined: 3 Oct, 2008
Posts: 36

Hello,
I have project that i have do with Unix scripting. The project is to create for four directory with North, South, East and West. Then within four directory create four departments Sales, Accounting, Inventory, and Manufacturing. Then create each directory of name of a person within each department, which I created Mike, Tom, Henry and Sam. Then create a test.txt file in each name directory. But structure in North has to have read only file, South structure should have hidden files, and East and West structure should have copy inhibit, which where I'm stuck. My assumptions is that you have take read only files from North and South with hidden files method and incorporate into East and West. But judging by professor is not the case. Can anybody help with this issue? Also the project mention that for East and West to copy inhibited, what's that meaning, if someone can explain what that means, then I can able get this project done.

Thank You
Deven

Here is my unix script project:
CODE

clear
mkdir ~/North
cd ~/North
mkdir ~/North/Sales
cd ~/North/Sales
mkdir Mike
cd Mike
touch Test.txt
cd ..
cd ..

mkdir ~/North/Accounting
cd ~/North/Accounting
mkdir Tom
cp -p ~/North/Sales/Mike/*.txt ~/North/Accounting/Tom
cd ..
cd ..

mkdir ~/North/Inventory
cd ~/North/Inventory
mkdir Henry
cp -p ~/North/Sales/Mike/*.txt ~/North/Inventory/Henry
cd ..
cd ..

mkdir ~/North/Manufacturing
cd ~/North/Manufacturing
mkdir Sam
cp -p ~/North/Sales/Mike/*.txt ~/North/Manufacturing/Sam
cd ..
cd ..

chmod 444 ~/North/Sales/Mike/Test.txt
ls -lt ~/North/Sales/Mike/Test.txt

chmod 444 ~/North/Accounting/Tom/Test.txt
ls -lt ~/North/Accounting/Tom/Test.txt

chmod 444 ~/North/Inventory/Henry/Test.txt
ls -lt ~/North/Inventory/Henry/Test.txt

chmod 444 ~/North/Manufacturing/Sam/Test.txt
ls -lt ~/North/Manufacturing/Sam/Test.txt

echo "--------------------------------------------------------------------------------"
#------------------------------------------------------------------------------

mkdir ~/South
cd ~/South
mkdir ~/South/Sales
cd ~/South/Sales
mkdir Mike
cd ~/South/Sales/Mike
touch .test.txt
cd ..
cd ..

mkdir ~/South/Accounting
cd ~/South/Accounting
mkdir Tom
cp -p ~/South/Sales/Mike/.test.txt ~/South/Accounting/Tom
cd ..
cd ..

mkdir ~/South/Inventory
cd ~/South/Inventory
mkdir Henry
cp -p ~/South/Sales/Mike/.test.txt ~/South/Inventory/Henry
cd ..
cd ..

mkdir ~/South/Manufacturing
cd ~/South/Manufacturing
mkdir Sam
cp -p ~/South/Sales/Mike/.test.txt ~/South/Manufacturing/Sam
cd ..
cd ..


ls -la ~/South/Sales/Mike/
ls -la ~/South/Accounting/Tom/
ls -la ~/South/Inventory/Henry/
ls -la ~/South/Manufacturing/Sam/

echo "--------------------------------------------------------------------------------"
#-------------------------------------------------------------------------------
mkdir ~/West
cd ~/West
mkdir ~/West/Sales
cd ~/West/Sales
mkdir Mike
cp -p ~/South/Sales/Mike/.test.txt ~/West/Sales/Mike
cd ..
cd ..

mkdir ~/West/Accounting
cd ~/West/Accounting
mkdir Tom
cp -p ~/South/Sales/Mike/.test.txt ~/West/Accounting/Tom
cd ..
cd ..

mkdir ~/West/Inventory
cd ~/West/Inventory
mkdir Henry
cp -p ~/South/Sales/Mike/.test.txt ~/West/Inventory/Henry
cd ..
cd ..

mkdir ~/West/Manufacturing
cd ~/West/Manufacturing
mkdir Sam
cp -p ~/South/Sales/Mike/.test.txt ~/West/Manufacturing/Sam
cd ..
cd ..

chmod 444 ~/West/Sales/Mike/.test.txt
ls -lta ~/West/Sales/Mike/.test.txt

chmod 444 ~/West/Accounting/Tom/.test.txt
ls -lta ~/West/Accounting/Tom/.test.txt

chmod 444 ~/West/Inventory/Henry/.test.txt
ls -lta ~/West/Inventory/Henry/.test.txt

chmod 444 ~/West/Manufacturing/Sam/.test.txt
ls -lta ~/West/Manufacturing/Sam/.test.txt

echo "--------------------------------------------------------------------------------"
#------------------------------------------------------------------------------

mkdir ~/East
cd ~/East
mkdir ~/East/Sales
cd ~/East/Sales
mkdir Mike
cp -p ~/South/Sales/Mike/.test.txt ~/East/Sales/Mike
cd ..
cd ..

mkdir ~/East/Accounting
cd ~/East/Accounting
mkdir Tom
cp -p ~/South/Sales/Mike/.test.txt ~/East/Accounting/Tom
cd ..
cd ..


mkdir ~/East/Inventory
cd ~/East/Inventory
mkdir Henry
cp -p ~/South/Sales/Mike/.test.txt ~/East/Inventory/Henry
cd ..
cd ..

mkdir ~/East/Manufacturing
cd ~/East/Manufacturing
mkdir Sam
cp -p ~/South/Sales/Mike/.test.txt ~/East/Manufacturing/Sam
cd ..
cd ..


chmod 444 ~/East/Sales/Mike/.test.txt
ls -lta ~/East/Sales/Mike/.test.txt

chmod 444 ~/East/Accounting/Tom/.test.txt
ls -lta ~/East/Accounting/Tom/.test.txt

chmod 444 ~/East/Inventory/Henry/.test.txt
ls -lta ~/East/Inventory/Henry/.test.txt

chmod 444 ~/East/Manufacturing/Sam/.test.txt
ls -lta ~/East/Manufacturing/Sam/.test.txt

echo "--------------------------------------------------------------------------------"
#------------------------------------------------------------------------------


This post has been edited by deven1974: 3 Oct, 2009 - 06:10 AM

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 07:27AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month