Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> automation help request
mkingiii
post Oct 27 2006, 12:35 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 11
Joined: 24-October 06
Member No.: 7,558



Is there a way to run a sequence of commands on a list/number of files without having to run them manually on each file. I want to unzip each file, perform a find and replace on each file, and then rezip each file. The command sequence I want to employ is:

gunzip file.gz ; perl -pi -e 's/YSN/LYS/g' file ; gzip file

Each file I want to do this to has a similiar name as follows:

./aa#/prod/#/#/final.pdb.gz (for example: ./aa1/prod/50/0/final.pdb.gz)

Thanks.
Go to the top of the page
 
+Quote Post
mkingiii
post Oct 27 2006, 02:13 PM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 11
Joined: 24-October 06
Member No.: 7,558



Ok, I know what I want to do can be done using a script file. However, I dont know how to write one. Can someone please help, this doesnt seem like that difficult a request for someone who knows what they are doing. Please help. I have 400000 files to run the commands on, so I really can not do this manually. I really need help to be able to apply the commands on a large scale.
Go to the top of the page
 
+Quote Post
markjr
post Oct 27 2006, 04:12 PM
Post #3


./configure
***

Group: Admin
Posts: 62
Joined: 9-February 06
Member No.: 6,054



QUOTE (mkingiii @ Oct 27 2006, 03:13 PM) *
Ok, I know what I want to do can be done using a script file. However, I dont know how to write one. Can someone please help, this doesnt seem like that difficult a request for someone who knows what they are doing. Please help. I have 400000 files to run the commands on, so I really can not do this manually. I really need help to be able to apply the commands on a large scale.


You can use things like the "for" loop in bash, or xargs (man xargs)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 01:22 AM