If I have:
foo
bar
..and I'd like to awk/sed this to:
foo-bar
..what's the syntax?
I'm trying to use:
system_profiler SPMemoryDataType | awk '/Type/ {print $2} /Speed/ {print $2}'|sed 's/\r$/a\"-"/'
to output type-speed (ie DDR-1067).
|
If I have: foo ..and I'd like to awk/sed this to: foo-bar ..what's the syntax? I'm trying to use:
to output type-speed (ie DDR-1067). |
|||||
|
|
Use this sed instead:
system_profiler SPMemoryDataType | awk '/Type/ {print $2} /Speed/ {print $2}'|sed '$!N;s/\n/ /' output:
|
|||||
|
|
Awk can easily do this on it's own, like so:
|
|||
|
|