Quantcast
Channel: grep with heredoc in function - Unix & Linux Stack Exchange
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

grep 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
Browsing all 4 articles
Browse latest View live


Latest Images