I want to replace a string (in the example the word Linux) with whatever is between the #'s on the first line.
So I want to turn:
#Windows#
1. Linux Sysadmin, Linux Scripting etc.
2. Databases - Oracle, mySQL etc.
3. Security (Firewall, Network, Online Security etc)
4. Storage in Linux
5. Productivity (Too many technologies to explore, not much time available)
into:
1. Windows Sysadmin, Windows Scripting etc.
2. Databases - Oracle, mySQL etc.
3. Security (Firewall, Network, Online Security etc)
4. Storage in Windows
5. Productivity (Too many technologies to explore, not much time available)
or
#Solaris#
1. Linux Sysadmin, Linux Scripting etc.
2. Databases - Oracle, mySQL etc.
3. Security (Firewall, Network, Online Security etc)
4. Storage in Linux
5. Productivity (Too many technologies to explore, not much time available)
into:
1. Solaris Sysadmin, Solaris Scripting etc.
2. Databases - Oracle, mySQL etc.
3. Security (Firewall, Network, Online Security etc)
4. Storage in Solaris
5. Productivity (Too many technologies to explore, not much time available)
Just using sed. I've got as far as: sed ' /^#[a-zA-Z ]*/{ h d } /Linux/ G'
I think what I need to do is is run a regular expression using the hold buffer as the replacement pattern which I guess would look like s/Linux/g but I can't find a way to do this.
Anyone got any ideas?