Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Xilinx
ZCU106
ZCU106 Vitis Platforms
Avnet SME ZCU106 Vitis Platform Workflow Training
Commits
06090cb5
Commit
06090cb5
authored
Aug 05, 2022
by
Jason Moss
Browse files
Update sed command to account for commented lines in configuration files.
parent
b76e52af
Changes
1
Hide whitespace changes
Inline
Side-by-side
2021.2/scripts/util/util-update-plnx-config.sh
View file @
06090cb5
...
...
@@ -39,7 +39,10 @@ else
if
grep
-Fq
$KEY
$CONFIG_FILE
;
then
# Replace existing configuration line
echo
-e
"
\t
OLD value :"
$(
cat
$CONFIG_FILE
|
grep
$KEY
)
sed
-i
"s@^
$KEY
=.*@
$REPLACE
@g"
$CONFIG_FILE
#sed -i "s@^$KEY=.*@$REPLACE@g" $CONFIG_FILE
#previous sed command did not match when the line started with a hashtag
# # CONFIG_xxx is not set
sed
-i
.orig
-E
"s@^(# |)
$KEY
.*@
$REPLACE
@g"
$CONFIG_FILE
echo
-e
"
\t
NEW value :"
$(
cat
$CONFIG_FILE
|
grep
$KEY
)
else
# Add new string
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment