Link to home
Start Free TrialLog in
Avatar of MaRiOsGR
MaRiOsGRFlag for Greece

asked on

Small shell script (read domains names from a text file and push them into command via a variable)

its like this i have a txt file with domains sorted like this :

mydomain1.com
mydomain2.com
mydomain3.com

they are almost 500 domains.

I want to run a command for each domain something like du -sh /mydomains/mydomain1.com/logfolder/
so I guess it has to be something like that du -sh /mydomains/$domains/logfolder/

how can I make the script read all the domains from the list, and each time replace the variable $domains and run the command till the list is over?

ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MaRiOsGR

ASKER

works great thank you!
no worries, glad to have helped