Unix Project

Unix Project Scripting

Page 1 of 1

0 Replies - 1890 Views - Last Post: 03 October 2009 - 07:09 AM

#1 deven1974   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 03-October 08

Unix Project

Posted 03 October 2009 - 07:09 AM

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:
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: 03 October 2009 - 07:10 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1