Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
edit XML file using variable in shell script.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jc6" data-source="post: 1129389" data-attributes="member: 85038"><p>Hi,</p><p></p><p>I am trying to edit a XML file using a shell script, but having some issues. Any help would be great. </p><p></p><p>I would like to edit the following string in a XML file that will be copied to a computer using a shell script. </p><p></p><p>When the file is copied to the machine, the value will have the following:</p><p><key>UserName</key></p><p><string>host/computer.mydomain.com</string></p><p></p><p>I would like to use a variable I have created in the shell script $COMPUTERNAME when changing the value. Below would be the desired output</p><p></p><p><key>UserName</key></p><p><string>host/$COMPUTERNAME.mydomain.com</string></p><p></p><p>Any ideas or suggestions would ge great.</p></blockquote><p></p>
[QUOTE="jc6, post: 1129389, member: 85038"] Hi, I am trying to edit a XML file using a shell script, but having some issues. Any help would be great. I would like to edit the following string in a XML file that will be copied to a computer using a shell script. When the file is copied to the machine, the value will have the following: <key>UserName</key> <string>host/computer.mydomain.com</string> I would like to use a variable I have created in the shell script $COMPUTERNAME when changing the value. Below would be the desired output <key>UserName</key> <string>host/$COMPUTERNAME.mydomain.com</string> Any ideas or suggestions would ge great. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
edit XML file using variable in shell script.
Top