This is what I have:
Code:
#!/bin/bash
#ascript.sh
WORD1=`tail -n +$1 /home/gscn/word1.txt | head -1`
sed -e "s/WORD1/$WORD1/g" < /home/gscn/configtmp > /home/gscn/config
WORD2=`tail -n +$1 /home/gscn/word2.txt | head -1`
sed -e "s/WORD2/$WORD2/g" < /home/gscn/config2tmp > /home/gscn/config2
tscript.sh
When I do:
It'll take the first word of both word1.txt and word2.txt files and put them in their respective config files. How do I make them separate? Like I want it so that I can do:
Which will take the first word of the first word1.txt and put it in the respective config file, then take the fifth word of word2.txt and put it in the respective other config file. How can I achieve this?