User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 363,432 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,126 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 621 | Replies: 3
Reply
Join Date: May 2008
Posts: 1
Reputation: akhil_hello is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
akhil_hello akhil_hello is offline Offline
Newbie Poster

Script to move files from one location to another

  #1  
May 1st, 2008
Hi,

I'm new to shell scripting. Can someone please suggest me some syntax to move files from directory A to directory B using shell scripting.

Also the programme should have 2 parameters and based on the parameter values given while executing, the programme should check the file names in directory and compare the letters from 3 to 7 to match the first parameter given to the shell script programme and 10 to 15 to match the 2nd parameter given in the programme and if both of them matches, then they should be moved to directory B.

I'm not expecting the entire code but atleast some suggestions would be great!!

Thanks a lot in advance

Akhil
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,319
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 7
Solved Threads: 110
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Virtuoso

Re: Script to move files from one location to another

  #2  
May 2nd, 2008
mv
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Jan 2007
Location: Ireland
Posts: 1,552
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Rep Power: 6
Solved Threads: 61
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: Script to move files from one location to another

  #3  
May 2nd, 2008
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote  
Join Date: Feb 2006
Location: Bristol, UK
Posts: 307
Reputation: chris5126 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 12
chris5126 chris5126 is offline Offline
Posting Whiz

Re: Script to move files from one location to another

  #4  
May 2nd, 2008
mv /dir1/* /dir2
If my post helped add to my rep!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 2:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC