Answer by Sergiy Kolodyazhnyy for grep with heredoc in function
You mentioned you're pasting to terminal. Abandon here-doc altogether, and use a proper clipboard utility, such as xclip (or pbpaste on Mac OS X). With xclip that'd be done as xclip -o -sel clip | grep...
View ArticleAnswer by Kusalananda for grep with heredoc in function
Your function would not be using a here-document: gsi () { grep --color "$@" } This would enable you to pass a pattern as well as any other options to grep on the common line and grep would read from...
View ArticleAnswer by Stéphane Chazelas for grep with heredoc in function
alias 'gsi=<<eof grep --color' Would work as alias is just like preprocessor text replacement, where the replacement is interpreted as shell code again. Yours was not working as you had that...
View Articlegrep with heredoc in function
I want to make function that parses from text pasted in a terminal. $ cat <<eof | grep --color sometext > foo > sometext > sometext1 > a sometext > asdf > > eof sometext...
View Article