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 ...
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 ...
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>...
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, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
grep × 5044awk × 1100
sed × 961
text-processing × 848
regular-expression × 721
bash × 712
linux × 567
shell-script × 479
find × 366
shell × 348
command-line × 235
search × 151
scripting × 135
files × 129
pipe × 124
cut × 96
string × 90
perl × 80
logs × 77
xargs × 69
ls × 67
macos × 67
wildcards × 63
tail × 63
sort × 62