aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/seq/seq.c
Commit message (Collapse)AuthorAgeFilesLines
* seq(1): Put separator only between the elements.Pawel Jakub Dawidek2023-12-221-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | - Using non-default ('\n') separator will produce an output with the separator at the end of the output, eg. % echo "[$(seq -s ' ' 0 2)]" [0 1 2 ] - The output should always be followed by a new line character. Currently: % seq -s ' ' 0 2 0 1 2 % This change makes seq(1) to behave the same way Linux seq(1): % echo "[$(seq -s ' ' 0 2)]" [0 1 2] % seq -s ' ' 0 2 0 1 2 % Approved by: oshogbo Differential Revision: https://reviews.freebsd.org/D43094
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* seq: style(9) cleanupEd Maste2023-07-211-16/+15
| | | | | | This is in part for diff reduction with OpenBSD. Sponsored by: The FreeBSD Foundation
* seq: combine asprintf return value checksEd Maste2023-06-251-7/+3
| | | | | | Error handling is identical for all of these failure cases. Sponsored by: The FreeBSD Foundation
* seq: fix check for rounding error/truncationEd Maste2023-06-191-9/+13
| | | | | | | | | | | | | | Based on OpenBSD 30f0fd29ba6c: > We need to compare the printable version of the last value displayed, > not the floating point representation. Otherwise, we may print the > last value twice. PR: 271964 Reported by: Daniel Kolesa Reviewed by: yuripv Obtained from: OpenBSD Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40601
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* seq: fix style nitsMariusz Zaborski2022-10-011-1/+1
| | | | MFC after: 2 weeks
* seq: fix potential NULL ptr referenceMariusz Zaborski2022-10-011-2/+6
| | | | | | | asprintf(3) allocates memory, and there isn't any guarantee of success. MFC after: 2 weeks Obtained from: OpenBSD
* seq(1): Require user-provided format strings to contain a conversionConrad Meyer2019-03-071-1/+2
| | | | | | | | | | | | | | This matches GNU seq, for example. For users that are looking for similar functionality, 'jot -b foo N' will print 'foo' N times. See jot(1). PR: 236347 Reported by: <y AT maya.st> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=344891
* seq(1): Move long_opts up with globalsKyle Evans2018-05-021-9/+9
| | | | Notes: svn path=/head/; revision=333155
* seq(1): Provide some long optionsKyle Evans2018-04-301-1/+11
| | | | | | | | | These match GNU seq(1) names where applicable for compatibility purposes. MFC after: 1 month Notes: svn path=/head/; revision=333122
* seq(1): Consistently include 'last' for non-integersConrad Meyer2018-02-271-19/+37
| | | | | | | | | | | | | | | | The source of error is a rounded increment being too large and thus the loop steps slightly past 'last'. Perform a final comparison using the formatted string values (truncated precision) to determine if we still need to print the 'last' value. PR: 217149 Submitted by: Fernando ApesteguĂ­a <fernando.apesteguia AT gmail.com>, Yuri Pankov <yuripv AT icloud.com> (earlier version) Reported by: Martijn Dekker <mcdutchie AT hotmail.com> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=330086
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* Sync with NetBSD, mainly address NetBSD bug #43355:Xin LI2014-12-181-28/+47
| | | | | | | | | | | Fix valid_format() to be more careful about allowing only valid printf formats. Obtained from: NetBSD MFC after: 2 weeks Notes: svn path=/head/; revision=275918
* Add missing static keywords to seq(1)Ed Schouten2011-11-061-15/+14
| | | | Notes: svn path=/head/; revision=227182
* Fix typos.Rebecca Cran2010-11-091-3/+3
| | | | | | | | PR: bin/148894 Submitted by: olgeni Notes: svn path=/head/; revision=215034
* Treat numbers after [Ee] a positive number rather than an invalidXin LI2010-02-201-1/+2
| | | | | | | one. Notes: svn path=/head/; revision=204107
* Add seq(1), a small utility to generate sequence number.Xin LI2010-02-191-0/+452
Obtained from: NetBSD MFC after: 3 months Notes: svn path=/head/; revision=204103