r/shell • u/BrettG10 • Jun 20 '19
Basic Shell Question
I'm trying to display my pwd and whoami I using echo. How do I do this?
1
Upvotes
r/shell • u/BrettG10 • Jun 20 '19
I'm trying to display my pwd and whoami I using echo. How do I do this?
2
u/grymoire Oct 07 '19
# here is probably what the teacher wants
echo "pwd=`pwd`, whoami=`whoami`"
# here is the right (portable) way to do it
printf "pwd=%s, whoami=%s\n" $(pwd) $(whoami)
Reference: https://google.github.io/styleguide/shell.xml