Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

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 $.+ ?

share|improve this question
    
You should accept your own answer if you don't expect there to be another better solution. – JustinStolle Dec 4 '11 at 21:09
up vote 5 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

share|improve this answer

You must log in to answer this question.

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