0

When I type:

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

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

$ ./somescript.sh <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 somescript.sh

2 Answers 2

2
# define a wrapper:
$ myfun() { ./somescript.sh "$1" "smart_${2//-/_}"; }

# call it
$ myfun file-script-test wa-foo-go
1

In the script you could modify the argument name

filename="smart_"$1
... operate on $filename

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .