Code to insert user into Tomcat config file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Code to insert user into Tomcat config file
# 8  
Old 05-05-2011
Code:
sed -i '$ i\<user username="'$user'" password="'$pword'" roles="'$roles'" />' input.txt

When $(last line) is used, </tomcat-users> is assumed to appear at the end of the file. and i that follows inserts the text right before </tomcat-users>(last line).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Setting config database user and password using sed

Hello everybody, I need to modify 200 files using a patern matching, I would like to do it with sed but it's not working with the following syntax: sed -e 's/DATABASE_PASSWORD.*oldpass/DATABASE_PASSWORD__', 'newpass/g' config.php need to find: define("__DATABASE_PASSWORD__", ... (6 Replies)
Discussion started by: dco
6 Replies

2. Shell Programming and Scripting

Insert a user input string after matched string in file

i am having file like this #!/bin/bash read -p 'Username: ' uservar match='<color="red" />' text='this is only a test so please be patient <color="red" />' echo "$text" | sed "s/$match/&$uservar\g" so desireble output what i want is if user type MARIA this is only a test so please... (13 Replies)
Discussion started by: tomislav91
13 Replies

3. UNIX for Beginners Questions & Answers

Possible to insert a few lines of code into a file at a specific point?

Hi Folks - How would I go about inserting a chunk of lines (3) into a specific portion of a file? The background is I have a script (non shell) that it executed daily, however on Sundays, I uncomment a section of code so that piece can be run as well. So I was hoping to write a piece of... (9 Replies)
Discussion started by: SIMMS7400
9 Replies

4. Solaris

Tomcat..Unable to deploy application remotely in tomcat

Hi, We have upgrade tomcat from 5.0.20 to 7.0.33 and made changes to server.xml file according to newer version.. how ever the upgrade went fine and now i am unable to deploy application remotely.. it is giving 403 access denied error.. we have seperate appbase directory mentioned in server.xml..... (0 Replies)
Discussion started by: phani4u
0 Replies

5. UNIX for Advanced & Expert Users

postfix config: how to relay mails for only one user of a certain domain

Hello there, First of all I tell you that this is my first postfix installation so please be patient... I have following scenario: fetchmail --> postfix --> amavis-new --> postfix --> exchange 2010. Everything -except exchange ;-)- runs on an opensuse 12.1 box. Now, I have a list of... (0 Replies)
Discussion started by: lpacor
0 Replies

6. SuSE

How to config root kde same as user?

Eclipse looks completely different when run under root compared to my user. It's like kde wasn't setup for root upon installation. I'm running Suse 9.3 Pro. How do I configure root kde so that eclipse looks the same when run as user? (3 Replies)
Discussion started by: shwick2
3 Replies

7. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

8. Shell Programming and Scripting

parsing config file to create new config files

Hi, I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below. I will be using the config file as mentioned below: (config.txt) country:a,b city:1,2 type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies

9. Solaris

Tomcat Error-HTTP Status code 500

when I typed path http://localhost:8080/MyFirst/HelloWorld in web-browser ,it came up with error HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception ... (0 Replies)
Discussion started by: srinivas2828
0 Replies

10. UNIX for Advanced & Expert Users

any reason for a user without a homedir - security/config/application?

Hi, Can I just quick pick everyone brain here about the following: There is a security audit going on at the company I work for and one of the things that needed to be resolved was that there were a lot of users who don't have a home directory. As this is a fairly large environment of over... (5 Replies)
Discussion started by: Solarius
5 Replies
Login or Register to Ask a Question
GLDEBUGMESSAGEINSERT(3G)					   OpenGL Manual					  GLDEBUGMESSAGEINSERT(3G)

NAME
glDebugMessageInsert - inject an application-supplied message into the debug message queue C SPECIFICATION
void glDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message); PARAMETERS
source The source of the debug message to insert. type The type of the debug message insert. id The user-supplied identifier of the message to insert. severity The severity of the debug messages to insert. length The length string contained in the character array whose address is given by message. message The address of a character array containing the message to insert. DESCRIPTION
glDebugMessageInsert inserts a user-supplied message into the debug output queue. source specifies the source that will be used to classify the message and must be GL_DEBUG_SOURCE_APPLICATION or GL_DEBUG_SOURCE_THIRD_PARTY. All other sources are reserved for use by the GL implementation. type indicates the type of the message to be inserted and may be one of GL_DEBUG_TYPE_ERROR, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, GL_DEBUG_TYPE_PORTABILITY, GL_DEBUG_TYPE_PERFORMANCE, or GL_DEBUG_TYPE_OTHER. severity indicates the severity of the message and may be GL_DEBUG_SEVERITY_LOW, GL_DEBUG_SEVERITY_MEDIUM, or GL_DEBUG_SEVERITY_HIGH. id is available for application defined use and may be any value. This value will be recorded and used to identify the message. length contains a count of the characters in the character array whose address is given in message. If length is negative then message is treated as a null-terminated string. The length of the message, whether specified explicitly or implicitly, must be less than or equal to the implementation defined constant GL_MAX_DEBUG_MESSAGE_LENGTH. ERRORS
GL_INVALID_ENUM is generated if any of source, type or severity is not one of the accepted interface types. GL_INVALID_VALUE is generated if the length of the message is greater than the value of GL_MAX_DEBUG_MESSAGE_LENGTH. SEE ALSO
glDebugMessageControl(), glDebugMessageCallback(), glGetDebugMessageLog(). COPYRIGHT
Copyright (C) 2012 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. AUTHORS
opengl.org opengl.org 06/10/2014 GLDEBUGMESSAGEINSERT(3G)