UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old November 2nd, 2004, 02:06 PM
Burlhouse Burlhouse is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 Burlhouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Copy files from a dir to a new one

I need to write a Bourne shell script to do the following:
(i)Copy a *.java and *.c files in /Home/MyHomeDir to a directory called /Home/MyHomeDir/NewDir

(ii)Make all the files executable and readable by everyone

Reply With Quote
  #2  
Old November 2nd, 2004, 08:31 PM
ShizukaWashi ShizukaWashi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Central Florida, U.S.A.
Posts: 77 ShizukaWashi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 56 m 55 sec
Reputation Power: 4
Send a message via AIM to ShizukaWashi Send a message via Yahoo to ShizukaWashi
#!/bin/sh

cp $HOME/*.java $HOME/new
cp $HOME/*.c $HOME/new

chmod 777 $HOME/new/*.c
chmod 777 $HOME/new/*.java

Reply With Quote
  #3  
Old November 3rd, 2004, 01:08 PM
Burlhouse Burlhouse is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 Burlhouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks it works perfectly!!

Reply With Quote
  #4  
Old November 5th, 2004, 07:11 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 44 m 45 sec
Reputation Power: 9
this perfecty && accidentally work
in unix, i would say
cd #this bingt me to home
[ -d ../new ] || mkdir ../new || exit 1
cp *.java *.c ../new
#he said: executable and readable by everyone
chmod 755 ../new/*.java ../new/*.c
ALL other is hazard (but working IN YOUR ENVIRONMENT)

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Copy files from a dir to a new one


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway