Variables in text file, how to get their values when printing out the text?
Hi!
I'm doing some bash-scripting and want to be able to print some text (just plain text) files into the new bash-scripts, created within a loop. Here's a short example of what I do: Code:
############### main bash script ################## Code:
############### file1.txt ################## Code:
############### bash_script_1 ################## Ida |
Presuming you call the scripts created on the fly, could you pass the variable values on the command line?
Code:
#!/bin/bash Code:
j=${0##*_} |
Hi!
I was able so solve the problem using the "sed" command: Code:
sed -e s#'$variable1'#$variable1#g -e s#'$j'#$j#g file1.txt >> bash_script_$j |
All times are GMT -5. The time now is 10:08 AM. |