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?

tripleee
  • 175,061
  • 34
  • 275
  • 318
yorgo
  • 477
  • 1
  • 6
  • 14
  • 2
    Then it's http://stackoverflow.com/questions/5505827/is-there-any-shortcut-to-reference-the-path-of-the-first-argument-in-a-mv-comman -- unfortunately, I can't close as duplicate again, but I invite you to do it yourself. – tripleee Dec 14 '15 at 09:42
  • name=inputfile sed 's/old/new/g' $name > $name.outputsuffix – Kane Blueriver Dec 14 '15 at 09:46

0 Answers0