Sponsored Content
Full Discussion: Using finger in a loop
Top Forums UNIX for Dummies Questions & Answers Using finger in a loop Post 302889481 by stew on Friday 21st of February 2014 12:20:54 AM
Old 02-21-2014
My first thread finger command issue was resolved. I have sent other message with subject "loading text file into table" with followng details

I have text file like below



Code:
Code:userreport.txt sinlgae34f,n,Mon,Aug,19,,2013,onggi11ggi11,n,Thu,Jul,12,,2012,onhca05hca05,n,Mon,Apr,4,,2011,on,r45f vr45fv,n,Fri,Feb,7,2014,16:5e43vg,4er34,n,Tue,Aug,21,,2012,onrt4566rt4566,n,Tue,Nov,12,2013,12:
I would like to load this userreport.txt file into table.

I used two program



Code:
program1: #!/bin/kshload datainfile 'userreport.txt'INSERT INTO lastlogonFIELDS TERMINATED BY ','(useridDayMonthDateyear )



Code:
Program 2: #!/bin/kshfilename=userreport.txtwhile IFS=, read doINSERT INTO lastlogondone

when I compile program 1: I am getting below error



Code:
loaddata.ksh[2]: load: not found+ infile userreport.txtloaddata.ksh[3]: infile: not found+ INSERT INTO lastlogonloaddata.ksh[4]: INSERT: not found+ FIELDS TERMINATED BY ,loaddata.ksh[5]: FIELDS: not found+ useridloaddata.ksh[7]: userid: not found+ Dayloaddata.ksh[8]: Day: not found+ Monthloaddata.ksh[9]: Month: not found+ Dateloaddata.ksh[10]: Date: not found+ yearloaddata.ksh[11]: year: not found


In program 2: not inserting into text file



Code:
+ filename=userreport.txt+ read+ IFS=,+ INTO lastlogonloaddata1.ksh[5]: INTO: not found

I want to inset .txt file into my new table.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finger and newsgroups

Hi, I've been using unix at college for a few weeks now and I have come up against a few stumbling blocks: - Most unix commands seem to work w/ regexps - the computers I and my group are allowed to logon to are all itsunXX where XX is a number. if I can {finger @itsun88} to find out that I and... (1 Reply)
Discussion started by: the_man_who
1 Replies

2. UNIX for Dummies Questions & Answers

finger

is there a way to show information on all the users on your system? when i use 'finger' is only shows users names and info who are currently on the system. is there a way to show all accounts? thanx! (5 Replies)
Discussion started by: djatwork
5 Replies

3. UNIX for Dummies Questions & Answers

Finger Information

Hey, I was wondering If anybody knew of a way to make a log of all users who type the command finger username when username is my own. I would like to see who is keeping track of me :) Thanks (3 Replies)
Discussion started by: hanley_ie
3 Replies

4. UNIX for Advanced & Expert Users

finger command

Hello all, Here is what I am trying to do. If a user exist, then send an echo "EXIST" or else "DOES NOT EXIST". (under HP-UX) Kind of: #!/usr/bin/sh USER=mylogin finger $USER if $? = 0 then echo "EXIST"" else echo "DOES NOT EXIST" fi (10 Replies)
Discussion started by: qfwfq
10 Replies

5. Shell Programming and Scripting

help in finger command.

Hi, iam using sunsolaris. when you type finger command -- it dispalys information about local and remote users. but here it shows as can't stat /dev/gold:8664 can anybody help what is the solution for this error. previously the output came. thanks, shan (1 Reply)
Discussion started by: shanshine
1 Replies

6. UNIX for Dummies Questions & Answers

finger question

How can I change the name in the 'finger' information? anybody has an idea? (2 Replies)
Discussion started by: ksainth
2 Replies

7. UNIX for Dummies Questions & Answers

finger

Is there any possible way to get rid of the header when I do finger ? I want to get rid of Login Name Tty Idle Login Time Office Office Phone as the header. Please let me know how to do it. (2 Replies)
Discussion started by: felixwhoals
2 Replies

8. UNIX for Advanced & Expert Users

finger command

I want to know the correct version of how i should use the finger command in this example below.(os is debian lenny) (nymserver.pl is located in /home/nymserv directory.) the two versions are : (in/etc/inetd.conf) finger stream tcp nowait nymuser /usr/nym/nymserv nymserv... (3 Replies)
Discussion started by: xstation
3 Replies

9. Shell Programming and Scripting

Finger has gone crazy

Two things : On the first place i am really desperate, on the second i am about to throw my laptop away to the recycle bin in a while. Ok now that i expressed my feeling let me describe you this mad situation. Code: print $1; ("finger -m " $1 "| head -1") | getline userinfo print... (6 Replies)
Discussion started by: beatblaster666
6 Replies

10. UNIX for Dummies Questions & Answers

Finger command help

Hi Does anyone know if there is anyway of doing the finger command for all user id's in my enviroment. What I need to obtain is the full names of all users on the system. I know if i do the finger command with no arguments it will list users currently logged in, but i need all users... ... (2 Replies)
Discussion started by: m3y
2 Replies
let(1)                                                             User Commands                                                            let(1)

NAME
let - shell built-in function to evaluate one or more arithmetic expressions SYNOPSIS
ksh let arg... DESCRIPTION
ksh Each arg is a separate "arithmetic expression" to be evaluated. EXIT STATUS
The following exit values are returned: 0 The value of the last expression is non-zero. 1 The value of the last expression is zero. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), set(1), typeset(1), attributes(5) SunOS 5.10 15 Apr 1994 let(1)
All times are GMT -4. The time now is 05:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy