Tag Info

Hot answers tagged

3

$ top -bn1 | grep free KiB Mem: 8117084 total, 6578888 used, 1538196 free, 302216 buffers KiB Swap: 8060924 total, 26004 used, 8034920 free, 1564856 cached $ top -bn1 | grep -oP '\S+(?=\s+free)' 1544132 8034920 requires GNU grep, but you've tagged "linux", so you're OK For just the "Mem": top -bn1 | grep -oP 'Mem.*\s\K\S+(?=\s+free)'


3

The first column mean the signal that is sent. Use kill -l for a list of all signal that are available on your system (see the oracle documentation for the meaning of the signals, here the most important ones). The second column indicates whether the signal is caught by a signal handler of the process or not. caught means that there is a signal handler ...


2

To support alternative key mappings you can use the GNU readline library's inputrc init file. Each user can have their own .inputrc file in their home directory. To check the current key map, enter verbatim mode (Ctrl-v) followed by the key to map. This will prevent the shell from parsing and executing the key and provide the key sequence. E.g. Ctrl-v ...


2

Using GNU sed (Linux only): top -bn1 | sed -rn '/Mem/{s/.* ([^ ]*) free.*/\1/p;}' Using any sed: top -bn1 | sed -n '/Mem/{s/.* \([^ ]*\) free.*/\1/p;}' Using perl: top -bn1 | perl -lne '/Mem.* ([\d]+)\s*free/ && print $1' Using a tool designed for the job (tested on Linux, not sure if free is available on Solaris): free | awk '/Mem/{print ...


2

awk -v RS="[, ]" '/free/{print a}{a=$0}' Explanation Set the record separator to , and space, so the number preceding every string is a record in itself, and so is the string. Having everything as its own record, awk will process every item one by one For all the records before free it will ignore the {print a} because the condition doesn't match, and it ...


1

Why can't the OpenSSH configure script detect OpenSSL explains the possible cause that might have occured in your case. Several reasons for problems with the automatic detection exist. OpenSSH requires at least version 0.9.5a of the OpenSSL libraries. Sometimes the distribution has installed an older version in the system locations that is detected ...


1

Assuming your script is portable, i.e. doesn't use bashisms, GNUisms, or whatever non POSIX, it should work with most Unix and Linux OSes with its #!/bin/sh shebang. However under Solaris 10 and older, /bin/sh is not the POSIX shell but the legacy Bourne shell which predates POSIX and is then missing features that came later with the standard. Your script ...


1

Answering my own question: This is a known issue with Sun SSH. The best workaround I found is to detect "Sun_SSH" in output of ssh -V and apply something like this: #!/bin/bash # .... ( ssh host 'localCommand' | remoteCommand || pkill -P $BASHPID ) You may also use $$ instead of $BASHPID in other shells or in simpler situations (if your shell doesn't have ...


1

The bc that comes with Solaris is quite historic. To get the same bc feeling as on Linux just install the gbc OpenCSW package.



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