Tag Info

New answers tagged

1

Check your quotes. In unix shells including bash: single quotes pass text unmodified to the program (so as you said passes ${PWW}, double quotes allow expansion of variables. In your example you want ${PWW} to be expanded but not $2, you can do this like this: awk "/${PWW}/"'{print $2}' awk /${PWW}/{print '$2'} awk "/${PWW}/{print \$2}"


4

Here is a pure-awk solution: $ awk 'FNR==NR{a[$1]=$2; next} {print a[$1]}' bar.txt foo.txt good bad okay large good bad How it works The script reads in bar.txt first and saves its information in array a. It then reads foo.txt and prints out the corresponding value. FNR==NR{a[$1]=$2; next} FNR is the number of lines read from the current file and NR ...


0

Found a hint here. I tried to apply the command with -n and it works!! The command should finally be pkgrm -n -a /export/home/admin mypackage


0

Probably to late but here goes. With Solaris 10 you need to edit /etc/resolv .conf and cp /etc/nsswitch.dns /etc/nsswitch.conf Also i am assuming you have bridged network in Virtual Box. If you have Host only it won't work. But as a test try to ping 8.8.8.8 Google dns server if you can then the solution stated above will work, otherwise you don't have ...


0

On Solaris, chmod 777 is setting an absolute mode. Absolute means absolute. If you want to keep ACLs, you need to use symbolic mode. See the man page: http://docs.oracle.com/cd/E23824_01/html/821-1461/chmod-1.html#scrolltoc


0

Just to be clear, are you using the "old awk" (/usr/bin/awk/) or the "new awk" (/usr/xpg6/bin/awk)? An online man page reference and GNU Awk's help page specifies the distinction quite clearly. Assuming if you are referring to "new awk" where you can use variable assignments via -v, you can also consider this: $ awk -v RS='name-' -v OFS='\t' 'NR>1{print ...


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 ...


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


2

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


0

My issue was with the /etc/resolv.conf - wrong domains to search upon, as well as non-existent DNS servers to provide lookups. Surprised I was able to login at all.


0

Making usb bootable for Solaris from Windows. Lets go. stop waisting time. format usb FAT (not FAT32 OR NTFS) Go http://www.oracle.com/technetwork/server-storage/solaris11/downloads/install-2245079.html and download x86 usb live media Go to http://www.osforensics.com/tools/write-usb-images.html an download imageusb Install imageusb software When open Step ...


0

You can expand the archive into a specific existing directory without using cd command like this: $ cat archive.tar.gz | ssh server2 "tar zxvf - -C /path/to/dir" If you don't know if the directory exits you can use this: $ cat archive.tar.gz | ssh server2 "mkdir -p /path/to/dir && tar zxvf - -C /path/to/dir"


0

As the error message states, your installation is missing a file (or a whole package). The following lines will sort it out. ls -l /usr/lib/mps/libnspr4.so grep libnspr4.so /var/sadm/install/contents pkgchk SUNWpr If SUNWpr is not installed, you need to add it with running pkgadd -d . SUNWpr from an installation media directory.


0

Change your script to use gawk instead o awk. Simple test: # pkg list|awk '{system("pkg verify $1")}' # # pkg list|gawk '{system("pkg verify $1")}' PACKAGE STATUS pkg://solaris/driver/storage/ssd ERROR


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.


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 # ...


0

I'm not really sure if I get the point of your question. At first: IFS is a variable, that contains a separator, like a tab, a space or something. By default it contains a space, tab and newline. EDIT: from a for-loop loop to a while-loop, suggested by terdon while read line do echo $line|cut -d\: -f2 done < /path/to/file.csv This generates ...


0

if you are running Solaris 11, then NWAM builds the /etc/resolv.conf and /etc/nsswitch.conf files are controlled by NWAM. The entries you need should be configured via svccfg commands, then when the network services start/restart, the files will be "created" based on the svccfg settings.



Top 50 recent answers are included