Please use
[code][/code] tags around your code and data, to preserve formatting and to improve readability. Please do not use quote tags, colors, or other fancy formatting.
Perhaps a better way may be to do something like this. Modify the lines in the above script to:
Code:
MODULES=( $(</path/to/modulefile ) )
DAEMONS=( hwclock syslog-ng network netfs crond $(</path/to/daemonfile) )"
I'm assuming that this is a bash or ksh script here, as I know of no other shells that use that syntax.
Create those files and put the entries you want inside them, whitespace-delimited. The script should then import them into the arrays. Any other script you write then also only has to append values to those files to make them available.
BTW, have you checked to see whether the script doesn't already support something similar?
Edit: BTW2, your sed command can be made more readable:
Code:
sed -i 's|#Server = ftp://mirror.aarnet.edu.au/pub/archlinux/$repo/os/$arch|Server = ftp://mirror.aarnet.edu.au/pub/archlinux/$repo/os/$arch|g' /etc/pacman.d/mirrorlist
sed can use any ascii character except newline and null as a substitution delimiter, not just "/".
I'm assuming that the $variables in the urls are meant to be kept literal here? The single quotes around the expression will keep them from expanding. But also, regex expressions match substrings, so you don't really need the whole url, just enough of it to be sure you're getting only the lines you want. You may want to anchor the match to the start of the line as well.
Code:
sed -i 's|^#Server = ftp://mirror.aarnet.edu.au|Server = ftp://mirror.aarnet.edu.au|g' /etc/pacman.d/mirrorlist