I want to run a command as a different user (the current user is root). Thus, I do
su newuser -c 'mkdir "/tmp/test"'
but I have a problem in passing arguments to it
i="name"
su newuser -c 'mkdir "/tmp/$i"'
or in a script
su newuser -c 'mkdir "/tmp/$1"'