07-09-2017
Replace string in a file.
Hopefully my request is a simple one. I need to replace, rather remove the string </IfModule> from a file, tls.conf. As I have a script that adds a bunch of other lines including that one to the end of the file.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a file with the following contents
# Lines that start with a # are comments.
#
# Calling TOAD like this will perform a comparison from command line :
#
# "C:\Program Files\Quest Software\Toad for Oracle 9.6\toad.exe" -c... (2 Replies)
Discussion started by: rajan_san
2 Replies
2. Shell Programming and Scripting
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies
3. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies
4. UNIX for Dummies Questions & Answers
Hi
I am looking for a particular string in a file.If the string exists, then I want to replace another string with some other text.Once replaced, search for the same text after that character position in the file. :wall:
E.g: Actual File content:
Hello
Name: Nitin Raj
Welcome to Unix... (4 Replies)
Discussion started by: dashing201
4 Replies
5. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies
6. Shell Programming and Scripting
Hi all, the value in the following file is just an example. It could be a different value/network addresses.
Here is my example of initial output in a file name net.txt
Initial Output, net.txt
The goal is to produce the following format which is to convert from CIDR to Netmask... (6 Replies)
Discussion started by: type8code0
6 Replies
7. UNIX for Dummies Questions & Answers
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies
8. Shell Programming and Scripting
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
Discussion started by: cozzin
9 Replies
9. Shell Programming and Scripting
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
10. UNIX for Beginners Questions & Answers
I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this.
string(Scenario 1)- user::r--,user::ourfrd:r--
String(Scenario 2)- user::r--
File
****
# file: /local/Desktop/myfile
# owner: me
# group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
LEARN ABOUT DEBIAN
sge_request
SGE_REQUEST(5) Sun Grid Engine File Formats SGE_REQUEST(5)
NAME
sge_request - Sun Grid Engine default request definition file format
DESCRIPTION
sge_request reflects the format of the files to define default request profiles. If available, default request files are read and processed
during job submission before any submit options embedded in the job script and before any options in the qsub(1) or qsh(1) command-line are
considered. Thus, the command-line and embedded script options may overwrite the settings in the default request files (see qsub(1) or
qsh(1) for details).
There is a cluster global, a user private and a working directory local default request definition file. The working directory local
default request file has the highest precedence and is followed by the user private and then the cluster global default request file.
Note, that the -clear option to qsub(1) or qsh(1) can be used to discard any previous settings at any time in a default request file, in
the embedded script flags or in a qsub(1) or qsh(1) command-line option.
The format of the default request definition files is:
o The default request files may contain an arbitrary number of lines. Blank lines and lines with a '#' sign in the first column are
skipped.
o Each line not to be skipped may contain any qsub(1) option as described in the Sun Grid Engine Reference Manual. More than one option
per line is allowed. The batch script file and argument options to the batch script are not considered as qsub(1) options and thus are
not allowed in a default request file.
EXAMPLES
The following is a simple example of a default request definition file:
=====================================================
# Default Requests File
# request group to be sun4 and a CPU-time of 5hr
-l arch=sun4,s_cpu=5:0:0
# don't restart the job in case of system crashes
-r n
=====================================================
Having defined a default request definition file like this and submitting a job as follows:
qsub test.sh
would have precisely the same effect as if the job was submitted with:
qsub -l arch=sun4,s_cpu=5:0:0 -r n test.sh
FILES
<sge_root>/<cell>/common/sge_request
global defaults file
$HOME/.sge_request user private defaults file
$cwd/.sge_request cwd directory defaults file
SEE ALSO
sge_intro(1), qsh(1), qsub(1), Sun Grid Engine Installation and Administration Guide
COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions.
SGE 6.2u5 $Date$ SGE_REQUEST(5)