Search results

  1. G

    Filter errors from sysctl -a output

    Nice Answer! grep post dump of stderr.. smart, very smart. $ sysctl -a | grep 'kernel.shm...|vm.dirty' | tr = ' ' | tr -s ' ' error: permission denied on key 'kernel.cad_pid' error: permission denied on key 'kernel.usermodehelper.bset' error: permission denied on key...
  2. G

    Filter errors from sysctl -a output

    @Aristarchus, to avoid all errors, I agree. However, that is not the question. I want to filter out the errors and only return the output for which I do have permissions. like this: kernel.shm_next_id -1 kernel.shm_rmid_forced 0 kernel.shmall 1073741824 <cut>
  3. G

    Filter errors from sysctl -a output

    I want to exclude error output for which the user has no permissions. It's unclear why grep -v is not filtering the output. $ sysctl -a | grep 'kernel.shm...|vm.dirty' | tr = ' ' | tr -s ' '|grep -v denied sysctl: permission denied on key 'fs.protected_hardlinks' sysctl: permission denied on...
Top