Skip to main content
5 votes
Accepted

Grep return No such File, after comand substituion

Nothing weird there, just the command substitution working. When you tested the command $(grep -R -I --exclude-dir=addons "^[^#]*print(" ) the shell first performed the command substitution ...
telcoM's user avatar
  • 101k
1 vote

Need to make multiple multiline replacements in file

Assuming you want to ONLY change blocks of text that match EXACTLY the block shown in your question and that your input always looks exactly as shown in your question then using any POSIX awk you ...
Ed Morton's user avatar
  • 32.4k
1 vote

Need to make multiple multiline replacements in file

After adding enclosing tag r to your XML: xmlstarlet ed -u '//filename' -v 'FILE_PATH/File Name' \ -u '//transname' -v '' file.xml <?xml version="1.0"?> <r> <type>...
Gilles Quénot's user avatar
1 vote

How to use grep to get the matching part only, without introducing extra newlines

Assuming you are using GNU grep: To prevent grep from adding a line break after each match you must use the -z option. Since with the -z option grep will no longer add any line breaks automatically, ...
Jonathan Cabrera's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible