Sponsored Content
Full Discussion: Tail with positive offset
Top Forums UNIX for Dummies Questions & Answers Tail with positive offset Post 302593830 by radoulov on Sunday 29th of January 2012 06:00:15 AM
Old 01-29-2012
It works fine on older systems. Run info coreutils 'tail invocation' on your system:

Code:
   For compatibility `tail' also supports an obsolete usage `tail
-[COUNT][bcl][f] [FILE]', which is recognized only if it does not
conflict with the usage described above.  This obsolete form uses
exactly one option and at most one file.  In the option, COUNT is an
optional decimal number optionally followed by a size letter (`b', `c',
`l') to mean count by 512-byte blocks, bytes, or lines, optionally
followed by `f' which has the same meaning as `-f'.

   On older systems, the leading `-' can be replaced by `+' in the
obsolete option syntax with the same meaning as in counts, and obsolete
usage overrides normal usage when the two conflict.  This obsolete
behavior can be enabled or disabled with the `_POSIX2_VERSION'
environment variable (*note Standards conformance::).

So you can enable the obsolete behavior with _POSIX2_VERSION:

Code:
% lsb_release -d
Description:    Ubuntu 11.10
% _POSIX2_VERSION=199209 tail +1 /etc/issue
Ubuntu 11.10 \n \l

%

Or just the modern syntax (you just need to add -n):
Code:
% tail -n +1 /etc/issue
Ubuntu 11.10 \n \l

%

This User Gave Thanks to radoulov For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

offset - informix chunk

Hello all, I am trying to add chunks to my informix dataspace. I have one dataspace ( the rootdbs ) and the new chunk is a raw device. Precisely slice1 on my new external harddisk. The question is, what should be the offset value. The document says, the offset is used by the engine to... (1 Reply)
Discussion started by: shibz
1 Replies

2. UNIX for Dummies Questions & Answers

Reading a file from a specified offset

Hi, I want to read a file from a specified offset from the start of file. With the read command, is it possible to do so. Please suggest. Is there any other alternative? Thanks, Saurabh (2 Replies)
Discussion started by: saurabhsinha23
2 Replies

3. Programming

Negative Offset

Function: int fcntl(int fd, int cmd, struct flock * lock) Data Type: struct flock This structure is used with the fcntl function to describe a file lock. It has these members: off_t l_start This specifies the offset of the start of the region to which the lock applies, and... (1 Reply)
Discussion started by: DNAx86
1 Replies

4. Solaris

how to calculate offset value to mb value in vxvm

root@erpqas# vxdg -g sap_dg free DISK DEVICE TAG OFFSET LENGTH FLAGS sapdisk3 c1t10d0s2 c1t10d0 15707513 2869 - sapdisk3 c1t10d0s2 c1t10d0 71080956 43335 - sapdisk5 c1t12d0s2 c1t12d0 70321149 803142 - ... (1 Reply)
Discussion started by: tv.praveenkumar
1 Replies

5. Solaris

NTP client offset

How to add offset to NTP client so that, for eg., clock is -20 seconds? (2 Replies)
Discussion started by: orange47
2 Replies

6. Shell Programming and Scripting

Joining multiple files tail on tail

I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250. I would like to join all 250 of them together tail by tail as follows. For example stat.1000 a b c d e f stat.1001 g h i j k l So that my output... (2 Replies)
Discussion started by: kayak
2 Replies

7. UNIX for Advanced & Expert Users

Grep --byte-offset not returning the offset (Grep version 2.5.1)

Hi, I am trying to get the position of a repeated string in a line using grep -b -o "pattern" In my server I am using GNU grep version 2.14 and the code is working fine. However when I am deploying the same code in a different server which is using GNU grep version 2.5.1 the code is not... (3 Replies)
Discussion started by: Subhamoy
3 Replies

8. UNIX for Dummies Questions & Answers

File name offset

Dear all, I want to offset the file numbers. can you please make some awk code or linux code for the same. Example: input file names ANI_WFMASS_PIST00001.gif ANI_WFMASS_PIST00002.gif . . . ANI_WFMASS_PIST0000n.gif offset --> 30 ANI_WFMASS_PIST00031.gif ANI_WFMASS_PIST00032.gif... (14 Replies)
Discussion started by: kri321shna
14 Replies
TAIL(1) 							   User Commands							   TAIL(1)

NAME
tail - output the last part of files SYNOPSIS
tail [OPTION]... [FILE]... DESCRIPTION
Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -c, --bytes=K output the last K bytes; alternatively, use -c +K to output bytes starting with the Kth of each file -f, --follow[={name|descriptor}] output appended data as the file grows; -f, --follow, and --follow=descriptor are equivalent -F same as --follow=name --retry -n, --lines=K output the last K lines, instead of the last 10; or use -n +K to output lines starting with the Kth --max-unchanged-stats=N with --follow=name, reopen a FILE which has not changed size after N (default 5) iterations to see if it has been unlinked or renamed (this is the usual case of rotated log files). With inotify, this option is rarely useful. --pid=PID with -f, terminate after process ID, PID dies -q, --quiet, --silent never output headers giving file names --retry keep trying to open a file even when it is or becomes inaccessible; useful when following by name, i.e., with --follow=name -s, --sleep-interval=N with -f, sleep for approximately N seconds (default 1.0) between iterations. With inotify and --pid=P, check process P at least once every N seconds. -v, --verbose always output headers giving file names --help display this help and exit --version output version information and exit If the first character of K (the number of bytes or lines) is a `+', print beginning with the Kth item from the start of each file, other- wise, print the last K items in the file. K may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. With --follow (-f), tail defaults to following the file descriptor, which means that even if a tail'ed file is renamed, tail will continue to track its end. This default behavior is not desirable when you really want to track the actual name of the file, not the file descrip- tor (e.g., log rotation). Use --follow=name in that case. That causes tail to track the named file in a way that accommodates renaming, removal and creation. AUTHOR
Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering. REPORTING BUGS
Report tail bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> Report tail translation bugs to <http://translationproject.org/team/> COPYRIGHT
Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for tail is maintained as a Texinfo manual. If the info and tail programs are properly installed at your site, the command info coreutils 'tail invocation' should give you access to the complete manual. GNU coreutils 8.12.197-032bb September 2011 TAIL(1)
All times are GMT -4. The time now is 05:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy