LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2007, 07:35 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
How to make newer "tail" behave like older "tail"


Hi guys

How can I make my "tail" binary in a FC6 install, which takes this parameter

tail -n +486

behave like an older version of tail, i. e. where I can just specify

tail +486

to get the same result from the "newer" tail on FC6 as the old syntax would have elicited??

Thanks...
 
Old 12-05-2007, 07:45 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
I thought the old style was like this, "tail -486", not using a + character. I believe this still works with the GNU tools version of tail.
 
Old 12-05-2007, 08:29 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Actually, the old-style option was +N to print out lines from N-th to the end. The new-style option does not permit it anymore, even if -N can still be used. However you can force tail to conform to the old POSIX standard, by setting the following environment variable
Code:
export _POSIX2_VERSION=199209
I don't know how this affects other commands, anyway. You can try to look for more detailed informations on the coreutils site.
 
Old 12-07-2007, 03:05 AM   #4
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
THANKS!!!!!

That last one was the key - much obliged!

 
Old 12-07-2007, 04:27 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You're welcome! To be sure, you can avoid problems with other commands by creating an alias for tail
Code:
alias tail='_POSIX2_VERSION=199209 tail'
in this way the variable _POSIX2_VERSION will be set only for the execution of tail.
 
  


Reply



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
how to stop "tail -f" in scipt? jimmyjiang Red Hat 16 06-30-2010 08:43 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
Howto end the "tail" command??? Schmurff Linux - Newbie 5 03-03-2004 05:32 AM
Error in Sendmail Tail : "apache set sender to <> using -f" cartfanatic39 Linux - Software 0 01-30-2004 10:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:39 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
Open Source Consulting | Domain Registration