LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2012, 07:33 PM   #16
tahaz
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled

hi tink
im getting this when i tried to run ur command on shell
Quote:
bash-2.05# last |tac|awk '$0 !~ /^[[:space:]]*$/ && $1 !~ /shutdown|reboot/ && $2 != "begins" {a[$1]=$0}END{for(i in a){print a[i]}}'
bash: tac: command not found
awk: a is not an array
 
Old 05-17-2012, 07:57 PM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Try
Code:
which tac
On my RHEL systems its in /usr/bin and is in the coreutils pkg.
HTH
 
Old 05-17-2012, 08:22 PM   #18
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by tahaz View Post
hi tink
im getting this when i tried to run ur command on shell
Hmmm ... if 'tac' isn't installed, use sed '1!G;h;$!d' instead :}

As for a is not an array: which OS are you on, what version of awk is this?



Cheers,
Tink
 
Old 05-29-2012, 04:57 PM   #19
tahaz
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
sorry for the late reply but manager was in a hurry to finish the audit so we just gave the customer the whole last log on the servers, much easier if you just want to dump last output to a file and pass it on
 
Old 05-30-2012, 07:06 PM   #20
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
No worries ... and it's totally OK to let the auditors do the heavy lifting ;D
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PAM login info required sheelavantar Linux - Security 2 03-15-2012 10:39 PM
Need help suppressing last login info geekdad Linux - Server 6 06-04-2008 06:08 PM
Need help suppressing last login info geekdad Linux - Server 1 06-04-2008 05:01 PM
copyright info at login thoron! *BSD 6 09-11-2007 02:10 PM
Linux last login info Hacker Linux - Security 6 07-18-2003 05:40 AM


All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration