Tag Info

Hot answers tagged

5

By GNU sed sed -n '/^name-/{s///;N;s/[a-z].*\s//p}' file JOHN NY TOM TX LILLY LA ROSY WA By GNU awk awk -F'[ -]+' '/name/{a=$2}/state/{print a,$3}' OFS='\t' file JOHN NY TOM TX LILLY LA ROSY WA By grep grep -o '[[:upper:]]\{2,\}' file | paste - - JOHN NY TOM TX LILLY LA ROSY WA


3

Here's another awk way (which, I now see, is just an uglier version of @Costas's): $ awk -F'[- ]' '($1~/name/){k=$2}($1~/school/){print k,$NF}' file JOHN NY TOM TX LILLY LA ROSY WA You can also use grep: $ grep -oP '^(name-\K\S+|school.*\s+\K.*)' file | paste - - JOHN NY TOM TX LILLY LA ROSY WA In your particular example, of course, you ...


2

It may be tempting to use eval, but as passwords can contain arbirary chars (which could/would be executed as code, it makes it risky; bordering on a plain-and-simple: "Don't do it!". This works - using arrays. Contents of test file User:blala Pass:blala with spaces: and colons: and $PATH IP:***.***.**.** set -f # ...


2

awk '/name/ {gsub(/name-/,""); printf "%s\t",$1} /school/ {print $3}' file JOHN NY TOM TX LILLY LA ROSY WA


2

This command should help you: svcs -l svc:/site/rclocal:default and in result you will see something like manifest /lib/svc/manifest/site/local.xml


1

Have been searching for this myself a while ago but unfortunately I did not succeed in starting Solaris 10 (or 11) using QEMU with sparc64. I stopped trying after I read the page http://wiki.qemu.org/download/qemu-doc.html#QEMU-System-emulator-for-non-PC-targets section 4.3 which states that the emulator is not usable but may boot some kernels.



Only top voted, non community-wiki answers of a minimum length are eligible