From nobody Mon Jan 15 18:31:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDLLl3zXgz57JP7; Mon, 15 Jan 2024 18:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDLLl3YWHz4R9H; Mon, 15 Jan 2024 18:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705343471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JY6HdtKQFNCq+45YRTYlgNgDE2YwuW9ng3GvoZAu/zU=; b=dRlDW5kize1mHTTh/0EW8bKDAxiOo/mDa5OdkFyfJ8fIIlMgM4QRkdIU6U4reAUR/nTFcG gzh/tyxBhPm3j1kVUKoxKKSj2avKATtYn83C1ckEoj1dlBUYxcKWg6JDVfG4zu8ECCp1Du xrA4Hqx8JBq1FabTkIYBLndUVUweDF0fW2Hyp5IplLRO5ZN6+MDzlwa5gCbhw3inf6uXuM oVXS/b/UrrUjvJz1mjwXtYVOSzPC+gSBzxh8VR9A9Od1AAJduEZi7q9nmeWoJ+wNwaR2lO JOPm79SX1wEqcgLboCCaNG8IFdv7LvILBzARuz1UgHHiwC0Iyega0tmqaKhApA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705343471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JY6HdtKQFNCq+45YRTYlgNgDE2YwuW9ng3GvoZAu/zU=; b=b8z9GCSsg/lPcpjmW7VH0G91oRUrdy3KuXbmK5o5JynLBcypToE+lOTuttWsdVxnUpkITm erKzaRfk0XgKRgC9HOBdDsm3FwMz/vQI2TEJJ3juQFG66W7O6oxPHaneT+lALs6DsrlA55 TAxzrm43EivW9bfX3Y/eERCmHz6Cu9gYTGkdvQeGnX7mtzOOYT4Be2UWHSifLwbetoClnA gpar5xBbSxL+isslJvsQU9nPcAk+eUQBtDHeKHwPyZ/CKj0glrcWzqSMFA98YEx23rYmac tm3WTp+3nEgXoUnTn3eMOFzgrKpSw1FzCeWzZU7QZ5RqGbPfLtcmSwnSYODPwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705343471; a=rsa-sha256; cv=none; b=pt/mMRiVaCMJ2kMj+6bQ0gqkSPpO5LQpnl6jD70j8P35MCC/Phc3ycnF+xcext5/oAWeFa w8ojMwplN7t9g6475uKXdexKz3vRtmy2TStstT7Vwe6+K2DGiuR2B3GBspDA4xD1bA3Ghc vYRTpy6VDdbr9JEUXwfdVth9KQvhu0UPUWgq+/P0S1+SBGSxpwFqviPNaGcEKA4uIJQQ5t NRzqjvO0fgzL/GTCVZPWqCr7clIcHVI+YQjXAAgsloiXUuHOBTIfWKuohMeSG4yDD7d/nt ZlgaXg5TXMWQCUXb+gGTPVQY3aK0Y/B8R0wllE+PG1pNX5+1y2blXO+PjKVfLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDLLl2f8Zz16n1; Mon, 15 Jan 2024 18:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FIVBZR026498; Mon, 15 Jan 2024 18:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FIVBrY026495; Mon, 15 Jan 2024 18:31:11 GMT (envelope-from git) Date: Mon, 15 Jan 2024 18:31:11 GMT Message-Id: <202401151831.40FIVBrY026495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ec13a838e685 - main - man: avoid unportable use of utilities List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec13a838e6857585d3c3db70a0a67e337248ec28 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec13a838e6857585d3c3db70a0a67e337248ec28 commit ec13a838e6857585d3c3db70a0a67e337248ec28 Author: Mohamed Akram AuthorDate: 2024-01-15 18:27:04 +0000 Commit: Warner Losh CommitDate: 2024-01-15 18:30:37 +0000 man: avoid unportable use of utilities echo -e is not portable. It can be replaced by printf %b (it works only with the /bin/sh built-in echo, not /bin/echo anyway). head -# is not portable, but head -n # is. Replace these two things in three places total. Signed-off-by: Mohamed Akram Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1062 --- usr.bin/man/man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 777726f880db..efb05603f912 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -312,7 +312,7 @@ man_check_for_so() { # We need to loop to accommodate multiple .so directives. while true do - line=$($cattool "$manpage" | head -1) + line=$($cattool "$manpage" | head -n1) case "$line" in .so*) trim "${line#.so}" decho "$manpage includes $tstr" @@ -897,11 +897,11 @@ search_whatis() { bad=${bad#\\n} if [ -n "$good" ]; then - echo -e "$good" | $MANPAGER + printf '%b\n' "$good" | $MANPAGER fi if [ -n "$bad" ]; then - echo -e "$bad" >&2 + printf '%b\n' "$bad" >&2 fi exit $rval