Skip to content

Commit 5ce1da4

Browse files
author
Joe Schaefer
committed
perl-for-cntrl-chars and [ -t 0 ] for terminal toggle
1 parent a64ce23 commit 5ce1da4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kubectl-node_shell

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ done
7575
if [ $# -gt 0 ]; then
7676
while [ $# -gt 0 ]; do
7777
cmd="$cmd, \"$(echo "$1" | \
78-
awk '{gsub(/\\/,"\\\\");gsub(/"/,"\\\"");gsub(/$/,"\\n");printf last}{last=$0} END{gsub(/\\n/,"",last);printf last}' \
78+
perl -pl -0777 -e 's/([\\"])/\\$1/g;s/\n$//;s/\n/\\n/g;s/([\x01-\x1f])/sprintf "\\u%04x",ord $1/ge' \
7979
)\""
8080
shift
8181
done

0 commit comments

Comments
 (0)