jmd9qs
March 2nd, 2009, 03:52 AM
hi all,
recently started learning how to create scripts. while messing around with a "script" i've made, i have run into a simple error. here's the script:
#! /bin/bash
who | wc -l >$users;
echo "There are currently $users users logged in"
~
i get this error:
{03-01-09 - 07:51 PM User: j}~$ nusers
/home/j/bin/nusers: line 2: $users: ambiguous redirect
There are currently users logged in
{03-01-09 - 07:51 PM User: j}~$
i know i'm overlooking something really simple here... any help? i've googled the "ambiguous redirect" and haven't found much to go off of...
recently started learning how to create scripts. while messing around with a "script" i've made, i have run into a simple error. here's the script:
#! /bin/bash
who | wc -l >$users;
echo "There are currently $users users logged in"
~
i get this error:
{03-01-09 - 07:51 PM User: j}~$ nusers
/home/j/bin/nusers: line 2: $users: ambiguous redirect
There are currently users logged in
{03-01-09 - 07:51 PM User: j}~$
i know i'm overlooking something really simple here... any help? i've googled the "ambiguous redirect" and haven't found much to go off of...