Re: Help with a Bash script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/04/10 16:29, Adalbert Prokop wrote:
> Am 08.04.2010 17:06, schrieb Michael Thompson:
> 
> Hi!

> 
> Well, if your list of commands already is a script, then including it 
> would be the most convenient method.
> 
> Let's say your list is called "script" then
> 
> . <path_to_script>
> 
> would do it...

Thats exactly the thought I came up with after sending the mail.

> 
> In other case here is a small executor script which reads your file line 
> by line and executes it:
> 
> #!/bin/bash
> # file: executor
> while read line; do
> 	echo Executing: "$line"
> 	eval "$line"
> done < "$1"

Thats exactly what I needed.

> 
> If you start the executor with your file as the first parameter, it will 
> execute the lines one by one.
> 
> # ./executor script
> 

Many thanks for your help there, much appreciated.

- -- 
Michael
http://maverickapollo.wordpress.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJLvfmeAAoJEEcwpNahApVBDs4H/04yGl12sLBb95inPW6yuJdg
r867BkHyttZv4EIF8uZVxNVf0LSe9yj4cqr+1rx68clKgoaaLi4AFPxY4C10a/9O
GYXojPqxSl5gOMYld8Y5eQ0nEqmo7o50hO4Pg2JOlnumunWTTpRsZfZFm8Jjpd48
dGz/stP117x9U+qALB+WjVcPdqX48+hK/ifky5Inofrs8YKOJdxT7ghO5GaOyJx1
5tmCgV7+avOcISdVjkSjvIQ2QQOWQ69+ZM7kjHB84e7tms3KaUMl0UrtNVoxG7QV
Ci4ISwExK9PZGoHbmon6o2dGuq9hwuDfJ8RmvBRy0Sm5AAqN2pQhrUC2cq9VEeQ=
=uf/v
-----END PGP SIGNATURE-----
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux