ref: 341b64b5bd0af48ec4bb7b11a54c953c52b22d03
parent: 41be41b4936b4d58312cc99993511f0f09d6161d
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Jun 4 18:47:07 EDT 2019
Remove trailing whitespace.
--- a/rc/bin/g
+++ b/rc/bin/g
@@ -1,4 +1,4 @@
-#!/bin/rc
+#!/bin/rc
rfork e
nl='
'
@@ -9,21 +9,21 @@
recurse=-n1
if not
flags=($flags $1);
- shift
-}
-if(~ $1 --)
- shift
+ shift
+}
+if(~ $1 --)
+ shift
-switch($#*){
-case 0
- echo 'usage: g [flags] pattern [files]' >[1=2]
- exit usage
-case 1
+switch($#*){
+case 0
+ echo 'usage: g [flags] pattern [files]' >[1=2]
+ exit usage
+case 1
pattern=$1
files=`$nl{walk -f $recurse | grep '\.([bcChlmsy]|asm|awk|cc|cgi|cpp|cs|go|goc|java|lx|ms|pl|py|rc|tex|xy)$' >[2]/dev/null}
-case *
- pattern=$1
- shift
- files=($*)
-}
+case *
+ pattern=$1
+ shift
+ files=($*)
+}
grep -n $flags -- $pattern $files /dev/null