Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Please bare with me, I'm rather new.
At the present time I am trying to take a bunch of files in a directory and append the date to the end of them and move them to a different directory.
At the present time I have to call the script and give it a file. I would like to be able to automatically go to a specific directory, append the date to the end of each file like above and then move the file to the new directory. And then repeat until the directory is empty.
Can anyone help me out regarding this, I'm not that great at programming, but I am learning. Any help would be greatly appreciated! Thanks
John
Raskin,
Thank you for the reply.
I was able to achieve what I wanted to do.
I created another script as you suggested and did this: for i in /home/magicman/update/*
do
/home/magicman/changename.sh $i
done
And it worked perfectly.
Thanks
I now have a little problem.
I have three scripts that need to run, but depend on which type of files are in a directory.
My three scripts are:
sendjpg
sendmp3
send
In my temp directory /tmp
If I have a file.mp3, run the sendmps, a jpg run sendjpg, and the rest of the files use the send script.
I would like to know how I can place this in a script:
If I have no files, do nothing
If I have mp3, run only sendmp3
If I have a jpg, run only sendjpg
If I have jpg and mp3, run them both.
etc etc.
I'm not sure on how to place this in a script to select the correct action.
John
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.