Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3432715ybi; Tue, 18 Jun 2019 00:21:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6ejFmfTmIUyL1dWfYmggUWvWqySGDkTLOIkemB9EKDykKIpjLMuWpotyvAxJWqLhSsGA/ X-Received: by 2002:a62:5253:: with SMTP id g80mr70341193pfb.179.1560842461075; Tue, 18 Jun 2019 00:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560842461; cv=none; d=google.com; s=arc-20160816; b=jLzqNGAAmTEv4tRNsIq25nGtp2WdErJEtslhHnXbYKj5hk/uZOImW+3ubiQEpSeLhR TIqBBjOU6vNJbP1pyi3So4dl2XImtmdELaeHanPbJzUgmR/aTHrd545YhB6jwAUIhTjA 8ofnCOzPzNjpEyXh4oWtpwHTtUk86+Zrz4cwHSIt9c3rPd74dptwx5QNsuLSBu4cQ5B0 oUmi0rKsG1rxo0+NDgP+0jhbJ1Bcq7PzR+KCgUzw3iPbKOLY0uWr+s9F13Ooqwmm2cgK desNE6EDjLTuabMuWvW4ieAD+4fYQ9OnyosZ1N9K+JmHP4ZbEpVZlztv8H72O5DYVbsH Uraw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4zVZ8e/Dim6JDg+jaoDpXKYzIIskhjtm1CMlrUWeV9Y=; b=JA4dqaHn3RBI8V8WiZSIbwQ6u2zxeFJuB5GdLsKUQbaQkuBiXJ1r/dWiDe/DP6A3zw JYUf+zEHbQJdbqpGqqgu1GcdWnxnR//uTy2cuIHnOe9fhLKY+BTDpWdQgMZAzptXrTDs YkGYs2AtcFk9LtxbLr2mbiF7zsacPelGre1t5p43+WYtncAu18nzlLRO1CziYUItXwZ3 8XFQaJ6HbwnmiwkVlfbT2QEPg9IJHOVHVtfc7SM/k8Zf3sCvN67XUlMiieGDiO+JJ+l5 CWkZ9OUVZSlM0IJZqLgd+El7z3s+UAuWowGRiJBvuQTAV4RYvxNatIL70deQfxVfj/yf OjBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mforney-org.20150623.gappssmtp.com header.s=20150623 header.b=itPVTNwm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si11854754pls.196.2019.06.18.00.20.45; Tue, 18 Jun 2019 00:21:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mforney-org.20150623.gappssmtp.com header.s=20150623 header.b=itPVTNwm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbfFRHTc (ORCPT + 99 others); Tue, 18 Jun 2019 03:19:32 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:39278 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbfFRHTc (ORCPT ); Tue, 18 Jun 2019 03:19:32 -0400 Received: by mail-pl1-f193.google.com with SMTP id b7so5319041pls.6 for ; Tue, 18 Jun 2019 00:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4zVZ8e/Dim6JDg+jaoDpXKYzIIskhjtm1CMlrUWeV9Y=; b=itPVTNwmUc18RRywOjbXTYCoYN5E9Rz7xn1o2D//JOvageoxeVd9YZbz+hFXc07lnZ kumqIdSUSDsfjEc720AP+HEfWgtwp43fcpUKqs1hpGgDtD8HOWnHjFm3ENuQmwLc7NPp izKa1K+jnMZJQakwzsERWIZ5wjg2TkffCtAfyGS5YOrYFRl3xvSvZtIQVv/mLvJf9zTh siRNbaFx71sGgTCWCRdTA2buH6D5MXTKvp3rZAM0s92/2AFLUPTWxMA2lyJ78KbxsOmN 600eIkfbe30YwDnR7+lnatGCveqNoFXg9Ib1HnwvmS9jo3d++D6IyRK1lmsThVteQSsz g+AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4zVZ8e/Dim6JDg+jaoDpXKYzIIskhjtm1CMlrUWeV9Y=; b=tmxLYnlkte7mx2i4RWDZpegbGRQEkfn5Yz3O/pHfaJREEtbcYWvuweK0Aiofho7VNE nSoePxAyWmKBdNDjngzo4sjw88RpKUrMbx+lNWZS4dOpa49ZCiG5fKR5+OASe78y08JO ceqskoVVtBXVMJHadmPdPAnoQ959nz7vWw5TSNgK6jUeYgU7B2+TDFXQHLEk3CLxrGw5 dkyE0Ktpa2YPWXdOsNL7PVpQXdjG4DkoOwbZEsc+YHPn/MdKkHp34/flvwKt37z5Arwe mDD37vQyWnQeg+09lkWhlEoLY7d3ZSwaOVxKm0S1pD8mWTYpHB6nRcGFsxCzPWSRGw2A 9Eiw== X-Gm-Message-State: APjAAAUzNL+b4+DiOb0nvP0R5BKKhkgo5xXVQuhbT1/S64Dk0IOKc1AG 4Q8REKZsbpJYVK5KACwxgIZ7Tozqgetvy1+s X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr84477436plb.46.1560835987882; Mon, 17 Jun 2019 22:33:07 -0700 (PDT) Received: from localhost ([2601:647:5180:35d7::cf52]) by smtp.gmail.com with ESMTPSA id h4sm945060pji.24.2019.06.17.22.33.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 22:33:07 -0700 (PDT) From: Michael Forney To: Will Deacon , Peter Zijlstra Cc: Boqun Feng , linux-kernel@vger.kernel.org Subject: [PATCH] locking/atomics: Use sed(1) instead of non-standard head(1) option Date: Mon, 17 Jun 2019 22:33:06 -0700 Message-Id: <20190618053306.730-1-mforney@mforney.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org POSIX says the -n option must be a positive decimal integer. Not all implementations of head(1) support negative numbers meaning offset from the end of the file. Instead, the sed expression '$d' has the same effect of removing the last line of the file. Signed-off-by: Michael Forney --- scripts/atomic/check-atomics.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh index cfa0c2f71c84..8378c63a1e09 100755 --- a/scripts/atomic/check-atomics.sh +++ b/scripts/atomic/check-atomics.sh @@ -22,7 +22,7 @@ while read header; do OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})" OLDSUM="${OLDSUM#// }" - NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)" + NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)" NEWSUM="${NEWSUM%% *}" if [ "${OLDSUM}" != "${NEWSUM}" ]; then -- 2.20.1