Skip to content
Advertisement

Tag: regex

Change file names by Perl [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 years ago. Improve this question How to change file names from notation like this: SomeCodeFile.extension to C/C++ notation:

How can I fix the following sed command?

I am trying to append _out to anything that matches the regex shown in the follwing sed command. The _out should be before the [ (]. The command returns the lines correctly as I expect. Now the problem comes when I try the following command where I define regions to use in the replacement. So for example if I have

Using a pipe (or) in sed

From a variable $(JS_SOURCES) containing something like make writes a file containing mod1,othermodule. It works with this code: And my question is Why can’t I replace the 3 expressions with one using pipes ? The shorter sed command doesn’t trim the string (the purpose of two of the expressions). Why doesn’t it work ? How to fix that (without resorting

Check for substring in Shell without Bashisms

I’m trying to write a shell script, and in it I have to look for the presence of -32 in a string. Unfortunately I have to do it without using any bashisms as it has to run on computers running Dash. I tried case ${1+”$@”} in *-32*);; but that will pick up something like -321. Is there a way to

Advertisement