Project

General

Profile

Bug #4149

ksh head builtin does not like newlines

Added by Jonathan Perkin over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2013-09-19
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Best served by an example:

# /bin/ksh
# printf "hello" >file
# type head
head is a shell builtin version of /usr/bin/head
# head -1 file
# /usr/bin/head file
hello# uname -v
joyent_20130111T180733Z
#

This breaks scripts which do e.g. kill `head -1 /some/pid/file` if the pidfile does not have a trailing newline, most notably SMF method scripts which are usually #!/sbin/sh

Also available in: Atom PDF