I'm converting Windows batch script .bat to Linux batch script .sh

What takes time a lot is to change the way .bat script use variables.

i.e.

In Windows

@set varName=122
echo %varName%

In Linux

varName=122
echo $varName

So the question is, how to replace %.+% to $.+ ?

link|improve this question

67% accept rate
You should accept your own answer if you don't expect there to be another better solution. – JustinStolle Dec 4 '11 at 21:09
feedback

1 Answer

up vote 4 down vote accepted

In the Replace dialog (Ctrl+H), use the following:

Find what: %(.+)%
Replace with: $\1
Search Mode: Regular expression

screen shot of replace dialog

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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