WTF, bash?

May 29, 2009 17:12

How can I haz output from command line application in shell variable? I'm writing a shell script that needs to know a users uid number. So I've tried UID=id -u $NAME and what I think might be every possible combination of grouping symbols, and none of them work. What the hell? The output is a SINGLE NUMBER. It should not be this hard to store it ( Read more... )

Leave a comment

Comments 1

mindstalk May 30 2009, 09:19:07 UTC
bash-3.2$ F=`id -u $NAME`
bash-3.2$ $F
bash: 50135: command not found
bash-3.2$ echo $F
50135

bash-3.2$ G="id -u $NAME"
bash-3.2$ $G
50135

Reply


Leave a comment

Up