Score:0

Pipe into command stored in bash variable

in flag

I enter two command in bash:

  1. $export g='grep "something"'
  2. $echo "something and another thing" | $g

But it doesn't work.

I want the second command to be evaluated by bash as : echo "something and another thing" | grep "something"

What should I do for that?

Score:1
in flag

use an alias.

alias g='grep "something"'
echo "something and another thing" | g
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.