Hello,
It has been a long time since I have written unix code and I need to insert a variable into the first position of each line in a file. Below is an example of the script and the desired output file
Here is my short script
server="$(hostname)"
df -kg | awk '{print $1, $2, $3, $4, $5, $6, $7}' > mountpoint.dat
Here is the contents of mountpoint.dat
/Filesystem GB blocks Free %Used Iused %Iused
/dev/hd4 0.25 0.09 63% 6496 23% /
/dev/hd2 4.00 2.07 49% 44947 9% /usr
I need the output in the following format for each line
server/Filesystem GB blocks Free %Used Iused %Iused
server/dev/hd4 0.25 0.09 63% 6496 23% /
server/dev/hd2 4.00 2.07 49% 44947 9% /usr
Thanks for your help!