|
Home > Archive > Unix Shell > November 2005 > Unix shell script for folders and files moving
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Unix shell script for folders and files moving
|
|
| mail.enes@gmail.com 2005-11-28, 7:50 am |
| Hi all,
I start with saying that I don't know anything about shell scripting so
please be mercifull 
I need to write a shell script that does the following:
-checks if current folder contains a file with a certain word in a
filename ex. foo in "foo1234.txt"
-if true, creates a new folder with a current date
-moves a folder "alpha" (that exists in current folder) in this new
folder
-copy the "foo1234.txt" file in this new folder
-in current folder renames "foo1234.txt" in "fee1234.txt"
If there is anyone willing to help me I would be very gratefull. Thank
you.
| |
| Chris F.A. Johnson 2005-11-28, 6:04 pm |
| On 2005-11-28, mail.enes@gmail.com wrote:
> Hi all,
> I start with saying that I don't know anything about shell scripting so
> please be mercifull 
> I need to write a shell script that does the following:
> -checks if current folder contains a file with a certain word in a
> filename ex. foo in "foo1234.txt"
> -if true, creates a new folder with a current date
> -moves a folder "alpha" (that exists in current folder) in this new
> folder
> -copy the "foo1234.txt" file in this new folder
> -in current folder renames "foo1234.txt" in "fee1234.txt"
What part of your homework assignment is giving you trouble?
If you expect help, please make an attempt, and post specific
questions.
IIWY, I'd read the man page for your shell, and look for "pattern
matching" or "filename expansion", as well as "command
substitution" and the built-in command "test" (a.k.a. "["). Then
read the man pages for "mkdir", "mv", and "date".
Once yo have done that, tackle each part of the assignment as a
separate task.
--
Chris F.A. Johnson
========================================
========================
If posting from Google Groups, please read this before replying:
<http://cfaj.freeshell.org/google>
| |
| mail.enes@gmail.com 2005-11-28, 6:04 pm |
| Thanks for the answer
|
|
|
|
|