From fec416c7638ce033134b4652989ad2e11dab90b7 Mon Sep 17 00:00:00 2001 From: terminalforlife Date: Wed, 6 Nov 2019 00:11:43 +0000 Subject: [PATCH] Show using awk without data via STDIN This is useful for those times you want to just do something in awk, - on-the-fly, without having to rely on its standard input (STDIN). It's especially handy when you want to perform floating-point arithmetic, if you're not a shell like ZSH which does support it. --- sheets/awk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sheets/awk b/sheets/awk index 67f6a07..e42a739 100644 --- a/sheets/awk +++ b/sheets/awk @@ -15,3 +15,6 @@ awk -v RS='' '/42B/' file # display only first column from multi-column text echo "first-column second-column third-column" | awk '{print $1}' + +# Use awk solo; without the need for something via STDIN. +awk BEGIN'{printf("Example text.\n")}'