sudo bash -c gave permission denied
In my linux (centos 7), there are 2 users A (normal user) and B (belongs to wheel group). I am trying to change User A’s .bash_profile file by running the following command with user B. ./test.sh /home/a/.bash_profile “export something” #!/bin/bash set -o errexit filePath=${1}; content=${2}; result=`sudo grep “$content” $filePath || true`\ if [[ -z $result … Read more