mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-11-22 05:53:09 +00:00
Fix copy_host_file
for files containing quotes (I hope)
`man printf` says \" is treated as a quote, but not \'. So let's have the command use double quotes to wrap the format, and escape any double quotes in the text. Hope this works.
This commit is contained in:
parent
3e44c7b99f
commit
e848ce768e
@ -88,7 +88,9 @@ sub clone_host_file {
|
|||||||
while (<$fh>) {
|
while (<$fh>) {
|
||||||
$text .= $_;
|
$text .= $_;
|
||||||
}
|
}
|
||||||
assert_script_run "printf '$text' > $file";
|
# escape any ' characters in the text...
|
||||||
|
$text =~ s/"/\\"/g;
|
||||||
|
assert_script_run "printf \"$text\" > $file";
|
||||||
# for debugging...
|
# for debugging...
|
||||||
assert_script_run "cat $file";
|
assert_script_run "cat $file";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user