Okay, I bet this is easy, but can't seem to pull it out...
I want to do a for loop substitution in an awk line, sorta like this:
for i in 1 2 3 4 5 6 7 8 9
do
user=`finger $LOGNAME | awk '{print ${@}}'`
echo "Hello $user"
done
If I put a number in for {@}, I get that field, but I just wanted a quick trick to print out all of the fields, so I don't have to count (& recount) to pull the field I need.
As it is, I get awk: syntax error near line 1
awk: illegal statement near line 1
awk: bailing out near line 1
Hello
...repeat...
appreciate the help,
Duane
I want to do a for loop substitution in an awk line, sorta like this:
for i in 1 2 3 4 5 6 7 8 9
do
user=`finger $LOGNAME | awk '{print ${@}}'`
echo "Hello $user"
done
If I put a number in for {@}, I get that field, but I just wanted a quick trick to print out all of the fields, so I don't have to count (& recount) to pull the field I need.
As it is, I get awk: syntax error near line 1
awk: illegal statement near line 1
awk: bailing out near line 1
Hello
...repeat...
appreciate the help,
Duane