0

I want to reuse the parameter I give to a shell command as an argument, e.g.

>sed 's/old/new/g' inputfile > $?.outputsuffix 

so that the result of sed is streamed to a file called "inputfile.outputsuffix".

I want a feature which works interactively at the Bash command line, not inside a script. Is such a thing available?

2
  • 2
    Then it's stackoverflow.com/questions/5505827/… -- unfortunately, I can't close as duplicate again, but I invite you to do it yourself. Commented Dec 14, 2015 at 9:42
  • name=inputfile sed 's/old/new/g' $name > $name.outputsuffix Commented Dec 14, 2015 at 9:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.