• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to fix this??  RSS feed

 
Sridhara Raju
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a line from a configure XML file:
<Server ListenPort="8001" Name="Server" RootDirectory="/production/les">
Here is the command that our shell script is using to try to strip the port number out of the .xml file:
SERVER_PORT=$(sed -n -e "/[\n\t ]*<[\n\t ]*Server[\n\t ]*ListenPort[\n\t ]*=[\n\t]*\"[0-9]*\"[\n\t ]*Name[\n\t ]*=[\n\t ]*\"$SERVER_NAME\"/p" $DOMAIN_DIRECTORY/config.xml | sed -e "s/[\n\t ]*<[\n\t ]*Server[\n\t ]*ListenPort[\n\t ]*=[\n\t]*\"//g" | sed "s/\"[\n\t ]*Name[\n\t ]*=[\n\t ]*\"$SERVER_NAME\"[\n\t ]*>[\n\t ]*//g")<br /> <br /> Here is the result of the command:<br /> 8001" Name="Server" RootDirectory="/production/les">

We need to modify the script so that it returns only the 8001 or whatever is after the ListenPort= value in the .xml file.
hopipng for early reply
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!