Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extracting spec info from finger. Post 302149289 by vgersh99 on Wednesday 5th of December 2007 01:38:27 PM
Old 12-05-2007
the above solution was not a bash solution.
here are a couple of alternatives ( there ARE others as well):
Code:
#!/bin/bash

# this one is generic, but uses temp file
finger -sf > /tmp/finger$$
read acct nameF nameL junk < /tmp/finger$$
echo "account->[${acct}] FIRSTname->[${nameF}] LASTname->[${nameL}]"
rm /tmp/finger$$

# this one is bash 2.x++ specific:
a=($(finger -sf))
echo "account->[${a[0]}] FIRSTname->[${a[1]}] LASTname->[${a[2]}]"

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

extracting info from Unix database to construct a visual diagram

Ok heres the situation, We use Solaris 8 at work with Sybase for the db. I need to be able to easily create visual diagrams of some of our more complex systems. I've been using Visio which is such a manual process and takes a while. I was thinking maybe using Visio somehow in conjunction... (0 Replies)
Discussion started by: fusion99
0 Replies

2. UNIX for Dummies Questions & Answers

Extracting Info

i have a file that contain lines like this 9.4.7.8.5.7.9.0.5.7.1.2.msisdn.sub.cs. 1 IN CNAME SDP01.cs. there are about 50,000 lines like this in the files i want to the extract the digits from the above line like:- 947857905712 OS Solaris9 (3 Replies)
Discussion started by: muneebr
3 Replies

3. Shell Programming and Scripting

How to unset 'finger' info?

Hi, Command "chfn" can be used to change finger information.. can anybody tell me how to unset i mean reset the same finger information. Thanks in advance, Chanakya (3 Replies)
Discussion started by: Chanakya.m
3 Replies

4. UNIX for Dummies Questions & Answers

Extracting specific info from finger command

Hello all, my unix is bash based and the finger command output is: Login Name Tty Idle LoginTime Office amos.john Amos John pts/26 1 Dec 5 16:18 (77.100.22.07) What am trying to achieve is extract the Login (amos.john) and Name (Amos John) from this output without using awk or sed. ... (1 Reply)
Discussion started by: franny
1 Replies

5. Programming

problems iterating in RUBY while extracting info from YAML, Pls help!

Hi all, I am stuck with a ruby script that extracts detials from yaml file and processes accordingly. the yaml file confivnic: device: vnic1: policy: - L2 mode: active vnic2: policy: - L3 - L4 mode: active type: aggr ... (1 Reply)
Discussion started by: wrapster
1 Replies

6. UNIX for Dummies Questions & Answers

Extracting 482/300k columns no's with respective info. listed in file2 from file1

Hi, I have 2 files File 1: 1 2 3 4 5 6 .......etc until column 300K 1 23 21 24 12 22 1 23 21 24 12 22 1 23 21 24 12 22 1 23 21 24 12 22 1 23 21 24 12 22 1 23 21 24 12 22 1 23 21 24 12 22 . . etc until row 1411 File 2: (14 Replies)
Discussion started by: sogi
14 Replies

7. Shell Programming and Scripting

matching and extracting info from text files

Hi all, I have two .txt file i.e. First text file: 2 4 1 4 Second text file 2 1.nii.gz 4 334.nii.gz 1 12.nii.gz 4 134.nii.gz If entry in 1st column of 1st text file matches the 1st column of 2nd text file, then copy the file (name of which is the second column) associated with... (4 Replies)
Discussion started by: vd24
4 Replies

8. Solaris

Extracting HBA Card Hardware info

Hello, I am very new to solaris so please bear with me. I have 2 machines in question. For both I am trying to get the HBA Card Hardware information such as: HBA Model Name HBA Firmware version HBA Port details HBA Driver details First machine is a Solaris 10. When I execute fcinfo... (6 Replies)
Discussion started by: flagman5
6 Replies

9. UNIX for Dummies Questions & Answers

Extracting specific info finger command

how to extract user machine name for current terminal using finger command below command gives machinename for all session , is it possible to filter it to only currernt terminal ? finger -b -p $LOGNAME | grep from (12 Replies)
Discussion started by: lalitpct
12 Replies

10. Shell Programming and Scripting

Have a situation while extracting info

i have a text file which i am generating from few sqls. format is like : col1 col2 col3 col4 col5 1001 DONE ABC 17-sep-14 12:02:05 1001 DONE ABC 17-sep-14 12:02:05 1001 DONE ABC 17-sep-14 12:02:55 1001 REDONE ABC ... (6 Replies)
Discussion started by: deepakiniimt
6 Replies
Finger(3pm)						User Contributed Perl Documentation					       Finger(3pm)

NAME
Net::Finger - a Perl implementation of a finger client. SYNOPSIS
use Net::Finger; # You can put the response in a scalar... $response = finger('corbeau@execpc.com'); unless ($response) { warn "Finger problem: $Net::Finger::error"; } # ...or an array. @lines = finger('corbeau@execpc.com', 1); DESCRIPTION
Net::Finger is a simple, straightforward implementation of a finger client in Perl -- so simple, in fact, that writing this documentation is almost unnecessary. This module has one automatically exported function, appropriately entitled "finger()". It takes two arguments: o A username or email address to finger. (Yes, it does support the vaguely deprecated "user@host@host" syntax.) If you need to use a port other than the default finger port(79), you can specify it like so: "username@hostname:port". o (Optional) A boolean value for verbosity. True == verbose output. If you don't give it a value, it defaults to false. Actually, whether this output will differ from the non-verbose version at all is up to the finger server. "finger()" is context-sensitive. If it's used in a scalar context, it will return the server's response in one large string. If it's used in an array context, it will return the response as a list, line by line. If an error of some sort occurs, it returns undef and puts a string describing the error into the package global variable $Net::Finger::error. If you'd like to see some excessively verbose output describing every step "finger()" takes while talking to the other server, put a true value in the variable $Net::Finger::debug. Here's a sample program that implements a very tiny, stripped-down finger(1): #!/usr/bin/perl -w use Net::Finger; use Getopt::Std; use vars qw($opt_l); getopts('l'); $x = finger($ARGV[0], $opt_l); if ($x) { print $x; } else { warn "$0: error: $Net::Finger::error "; } BUGS
o Doesn't yet do non-blocking requests. (FITNR. Really.) o Doesn't do local requests unless there's a finger server running on localhost. o Contrary to the name's implications, this module involves no teledildonics. AUTHOR
Dennis Taylor, <corbeau@execpc.com> SEE ALSO
perl(1), finger(1), RFC 1288. perl v5.8.8 2001-11-02 Finger(3pm)
All times are GMT -4. The time now is 08:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy