I am using sed
in bash shell script
. I want to add some text, which is defined as shell variable, in the first place of each line using sed
.
For example,
cat filename
1.cfg
2.cfg
...
100.cfg
In the script,
#!/bin/bash
currentd="/home/test/"
sed "/WHAT SHOUL I DO to add $currentd/" filename > filepath
I want to add the file path currentd
in the first place of the each line in filename
and get filepath
file.