On 06Jun2015 21:53, bruce <badouglas@xxxxxxxxx> wrote:
Evening..
Morning...
As a test, the following is an attempt to replace "text" from a test
file with "text" from an external file.
aa=$(cat www1.txt)
BTW, this can be written:
aa=$(< www1.txt)
sed -i "s*#\tISSUES/NOTES::*$aa*g" foo.py1
When I check the foo.py1 file, I get "$aa" in the file, instead of the
replacement text.
Are you sure you used the exact command above? If you have used single quote I
would have expected such a result, but not with double quotes.
The test is using replacement delimeters for the sed, as the
replacement text has slashes...
I'm fond of ^G for this purpose:-)
thanks for any pointers.
When debugging sed scripts and other fiddly shell commands it is often useful
to trace the actual executed command, thus:
( set -x; sed -i "s*#\tISSUES/NOTES::*$aa*g" foo.py1 )
which will should the issued sed command, after the shell has done its
mangling.
Cheers,
Cameron Simpson <cs@xxxxxxxxxx>
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org