LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2010, 10:03 AM   #1
burwood_301
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
Post Shell scripting help needed


Hi All,

I had a requirement to create a shell script.we have multiple folders which contains files .The format of the files is filename_date.
so we need to copy all these filenames as well as paths to a single folder to a single file.For next day run it should copy only new files which are added to these folders.we need to have another logfolder for storing filenames in order to compare the filenmaes with the source folders. logfolder will have all the files(history) i.e whatever the files copied to single file.we need to pass the source directory name as a parameter.

source path : abcxyz/home/export/xyz
/abc
/sss
xyz, abc, sss are sub directories in export directory.
In xyz,abc,sss sub directories we will have files.
Kindly please give me an idea how a write a bash shell script for this scenario.

Thanks,
Burwood_301
 
Old 04-19-2010, 10:13 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello and welcome to LinuxQuestions,

Your question sound very much like homework and the answers can very easily be found using Google. Please put in some time and work instead of relying on LQ to do everything for you. You'll learn a lot more trying for yourself. Of course if you have something put together and are encountering errors, that's when you turn to LQ.

Kind regards,

Eric
 
Old 04-19-2010, 11:13 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,961

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by burwood_301 View Post
Hi All,

I had a requirement to create a shell script.we have multiple folders which contains files .The format of the files is filename_date.
so we need to copy all these filenames as well as paths to a single folder to a single file.For next day run it should copy only new files which are added to these folders.we need to have another logfolder for storing filenames in order to compare the filenmaes with the source folders. logfolder will have all the files(history) i.e whatever the files copied to single file.we need to pass the source directory name as a parameter.

source path : abcxyz/home/export/xyz
/abc
/sss
xyz, abc, sss are sub directories in export directory.
In xyz,abc,sss sub directories we will have files.
Kindly please give me an idea how a write a bash shell script for this scenario.

Thanks,
Burwood_301
Ok. Go to Google, and look up any one of the thousands of bash scripting tutorials. Read them.

Also, when you say "date", you do realize that there are LOTS of ways to do a 'date'? Same for "filename". I agree with others that this sounds very much like homework. If you want help, then post what you've written already, and where you're stuck. If you want someone to write it for you, good luck.
 
Old 04-19-2010, 03:00 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

For starters, what books or other reference material are you using?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting Geeks, advice and assist needed :-) WhisperiN Programming 6 09-25-2009 02:02 AM
LXer: Terminal functions for shell scripting with Shell Curses LXer Syndicated Linux News 0 03-27-2008 12:50 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 05:29 AM
shell scripting - help needed jonhewer Linux - Newbie 54 09-09-2005 03:58 PM
Shell scripting and background processes - help needed. trafalgar Programming 3 06-08-2003 10:15 AM


All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration