09-12-2014
I am accepting word to replace with new word from user and then using these i am making changes in my file, but the sed is not working in shell
for eg:
where word and newword i am reading from user input
sed -i 's/$word/$newWord/g' item.dat
its not giving error but not making changes either.
Could someone please help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
MSG="THERE WERE XX RECORDS IN ERROR TABLE,AAAA, WHEN LOADING THE BBBB TABLE WITH EXTRACT FROM CCCC INTO TABLES FOR , DATABASE DDDD."
echo "$MSG" > /tmp/mplanmsg.$$.out
I wan to replace XX with the content in $recordXX
cat /tmp/mplanmsg.$$.out|sed 's/XX/\$recordXX/g'| sed... (3 Replies)
Discussion started by: leemjesse
3 Replies
2. Shell Programming and Scripting
Hi,
I have a file which contains a word like ravi and ravi30.
i want to replace only the word ravi with xxx for that i am using the below sed command
sed -e 's/ravi/xxx/g' .
but the above command out put is xxx and xxx30 but i dont need to change ravi30
please guide me how to proceed.... (4 Replies)
Discussion started by: ravi_rn
4 Replies
3. Shell Programming and Scripting
All,
I have the following file:
--------------------------------------
#
# /etc/pam.d/common-password - password-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define the services... (2 Replies)
Discussion started by: RobertBerrie
2 Replies
4. Shell Programming and Scripting
Hi all,
if I have the following piece (repeating) of text within a file and I wish to delete it via sed
a
b
c
d
e
<tr>
<td><img alt="" height="1" width="3" src="/testweb/view/browser/images/shim.gif"></td><td><img alt="" height="1" ... (4 Replies)
Discussion started by: srage
4 Replies
5. Shell Programming and Scripting
Unfortunately this chap has been banned for some reason and I was looking forward to the resolution of his question: -
https://www.unix.com/shell-programming-scripting/123118-append-position-28-33-a.html
He was asking if you can use sed to match a pattern you want to replace within a... (6 Replies)
Discussion started by: steadyonabix
6 Replies
6. Shell Programming and Scripting
Hello All,
I have the following lines in a file
<address location="test"
ConnectionName="test" />
I want to replace the above lines by
<address location="test123" />
I am usind SED and not able to remove the new line characters between the two lines.
Can anyone please help... (4 Replies)
Discussion started by: ramk
4 Replies
7. Shell Programming and Scripting
I have a bunch of conf files, that contain the fully qualified names of servers. I would like to be able to use some sort of pattern matching with sed or vi, or whatever, to pull out the fully qualified server names, and dump them in a file.
It just needs to work across several unix os. So, I... (4 Replies)
Discussion started by: tabini
4 Replies
8. Shell Programming and Scripting
Hi
My log file is Testtmp2
cat Testtmp2
12:12:38
12:14:29
12:17:34
12:19:08
12:20:10
12:21:35
12:22:20
12:22:26
12:22:34
12:22:38
12:28:14
12:31:35
12:32:50
12:33:04 (3 Replies)
Discussion started by: rahkumar
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
i have data file like:
START1
a
b
STOP
c
d
START2
e
STOP
f
START3
g
STOP
When one of the START<count> variable is passed, i should print all lines matching this until the first 'STOP'
for example if 'START2' is provided for match, i should get the result as:
START2 (1 Reply)
Discussion started by: ysrini
1 Replies
10. Shell Programming and Scripting
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
LEARN ABOUT DEBIAN
sql::reservedwords::sqlserver
SQL::ReservedWords::SQLServer(3pm) User Contributed Perl Documentation SQL::ReservedWords::SQLServer(3pm)
NAME
SQL::ReservedWords::SQLServer - Reserved SQL words by SQL Server
SYNOPSIS
if ( SQL::ReservedWords::SQLServer->is_reserved( $word ) ) {
print "$word is a reserved SQL Server word!";
}
DESCRIPTION
Determine if words are reserved by SQL Server.
METHODS
is_reserved( $word )
Returns a boolean indicating if $word is reserved by SQL Server 7, 2000 or 2005.
is_reserved_by_sqlserver7( $word )
Returns a boolean indicating if $word is reserved by SQL Server 7.
is_reserved_by_sqlserver2000( $word )
Returns a boolean indicating if $word is reserved by SQL Server 2000.
is_reserved_by_sqlserver2005( $word )
Returns a boolean indicating if $word is reserved by SQL Server 2005.
reserved_by( $word )
Returns a list with SQL Server versions that reserves $word.
words
Returns a list with all reserved words.
EXPORTS
Nothing by default. Following subroutines can be exported:
is_reserved
is_reserved_by_sqlserver7
is_reserved_by_sqlserver2000
is_reserved_by_sqlserver2005
reserved_by
words
SEE ALSO
http://msdn2.microsoft.com/en-us/library/ms130214.aspx
AUTHOR
Christian Hansen "chansen@cpan.org"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2008-03-28 SQL::ReservedWords::SQLServer(3pm)