I have been trying to find the answer to this question for awhilea while. I am writing a quick script to run a command based on output from awk.
ID_minimum=1000 for f in /etc/passwd; do awk -F: -vID=$ID_minimum '$3>=1000 && $1!="nfsnobody" { print "xfs_quota -x -c 'limit bsoft=5g bhard=6g $1' /home "}' $f; done The problems are that the -c-c argument takes a command in single quotes and I can't figure out how to properly escape that and also that $1$1 doesn't expand into the username.
essentiallyEssentially I am just trying to get it to output:
xfs_quota -x -c 'limit bsoft=5g bhard=6g userone' /home xfs_quota -x -c 'limit bsoft=5g bhard=6g usertwo' /home etc...