lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 6d494f9 2/2: Prefer a pipe to a temporary fil


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6d494f9 2/2: Prefer a pipe to a temporary file
Date: Thu, 30 May 2019 10:47:07 -0400 (EDT)

branch: master
commit 6d494f96a3e9f8cd5481e49b41f48b2b3d428288
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Prefer a pipe to a temporary file
    
    See:
      https://lists.nongnu.org/archive/html/lmi/2019-05/msg00065.html
---
 check_script.sh | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/check_script.sh b/check_script.sh
index f0c4a09..ebfddb8 100755
--- a/check_script.sh
+++ b/check_script.sh
@@ -39,11 +39,7 @@ case $shebang  in
         shellcheck --external-sources "$1"
     ;;
     ("#!/bin/zsh")
-        new_name="/tmp/$(basename "$1")$(date -u +'%s_%N').eraseme"
-        cp -a "$1" "$new_name"
-        sed -i "$new_name" -e'1s/zsh/sh/'
-        shellcheck --external-sources "$new_name"
-        rm "$new_name"
+        sed -e'1s/zsh/sh/' "$1" | shellcheck --external-sources -
     ;;
     ("#!/usr/bin/make") ;;
     ("#!/bin/sed") ;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]