finger a list from a file

I am trying to find a way of fingering the first field in a listfile created from the who command, and write the results to a new file

eg

"`who | cut -f1 -d' '` | more > tam"
gives me the list I need

but

tam -f1 finger > tam2
does not produce the right results

Thank you in advance for any help even a pointer in the right direction

What are you trying to do with the above command ?
tam is not command. It is just a file.

sorry bhargav I am trying to interrogate the file sequentially and finger each of the individual users

<tam> file

hb1
hb2
hb3
dr33
tr55
etc

I want to create a new file that would show the following

Login name: hb1 In real life: Client Name
Directory: /export/home/localuser Shell: /bin/ksh
Last login Tue Feb 22 16:20 on pts/11 from 160.20.56.16
No unread mail
No Plan.

Login name: hb2 In real life: Another Name
Directory: /export/home/opluuser Shell: /bin/ksh
Last login Tue Feb 22 16:20 on pts/28 from 145.110.53.01
No unread mail
No Plan.

etc

Do as follows ...


>userActivity.log
who | cut -d" " -f 1 | sort -u > users

while read user
do
  finger $user  >> userActivity.log
done < users

Champion Mate works a treat can use this as part of a larger script I'm working on

Use :
who | cut -d' ' -f1 | head -1 | xargs finger
Easiest way to do what u want.

Use :
who | cut -d' ' -f1 | head -1 | xargs finger
Easiest way to do what u want.

I guess OP (Original Poster ?) needs to get the activity of all the users not just one user.

And if you do n't use sort , you will end up using 'finger' multiple times for a user.

try ....

finger `who | awk '{print $1}' | sort -u` > activity.log

or ...

finger `who | cut -d " " -f1 | sort -u` > activity.log