How can I combine these two examples with pushd and whoami to change the directory?
I know I can change the directory like this:
#!/bin/bash
pushd /home/mike/Pictures > /dev/null
# do something in the new dir
ls
popd > /dev/null
And I know I can get the username like this:
#!/bin/bash
theuser=`whoami`
echo $theuser
whoami, if I understand your request correctly. Justpushd -n ~/Pictureswould do.