On 27.06.2022 05:59,
[email protected] wrote:
I've two files, named as "__tmp.symbols" and "gap.tmLanguage" respectively, and they can be retrieved from here [1]. When I try to run the following sed command using these two files, an error will be triggered as follows:
$ sed -E -i "s/^(\s*<string>\\\b\().*IsGroup.*(\)\\\b<\/string>$)/\1$(cat ./__tmp.symbols)\2/g" gap.tmLanguage
bash: /usr/bin/sed: Argument list too long
Any hints for fixing it?
Obviously the contents of file __tmp.symbols are far too many so
that $(cat ./__tmp.symbols) will expand to a too long line.
My guess is that you wanted to do something different than putting
the whole content of a file into a sed _substitution argument_?
Anyway, to fix that use a more appropriate approach, like matching
the pattern and printing the contents at the matched place. A tool
like awk (for example) will provide you with that solution.
Janis
[1] https://github.com/hongyi-zhao/temp/tree/master/sed
Regards,
HZ
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)