You are not logged in.
I would like to use the following commands to read a text from file into variable and then append the text to a certain place inside another text. I am using includeRules as "anchor" that will be overwritten to indicate the place for the text.
test=`cat textfile`
sed -i 's|^.includeRules.*$|#includeRulesn"'${test}'"|' $othertextfile
After executing these commands, I get "/bin/sed: Argument list too long". What program could I use instead of sed to enter the text to its place?
Offline
Even Perl doesn't seem to like that long string: when I try:
perl -i -wpe "s/includeRules/$test" $othertextfile
I also get the same error: /usr/bin/perl: Argument list too long
Offline
I found my answer. In other parts of the code I can run the sed command multiple times and this way have smaller strings in a variable.
EDIT: the whole problem was actually caused because I had many characters included that were interpreted as control signs, like and "". This messed up sed logic.
Offline