Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I type:

$ ./ <file-script-test> wa-foo-go`

I want it to change that automatically so that it thinks I typed:

$ ./ <file-script-test> smart_wa_foo_go 

Or others like bk-bar-rr turning into smart_bk_bar_rr

All are in the same format of xx-xxx-xx and all need the smart_xx_xxx_xx "conversion"

I just don't want to type it all out every time I run this

share|improve this question
# define a wrapper:
$ myfun() { ./ "$1" "smart_${2//-/_}"; }

# call it
$ myfun file-script-test wa-foo-go
share|improve this answer

In the script you could modify the argument name

... operate on $filename
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.