Sponsored Content
Top Forums Shell Programming and Scripting Escape special characters in SED Post 302658639 by aakishore on Tuesday 19th of June 2012 04:43:11 PM
Old 06-19-2012
Thanks a bunch..it worked..
Don't mind can you please explain the command..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed with special characters

Hi, I am reading a file (GC_JAR.log) which has entries like: 511725.629, 0.1122672 secs] 525268.975, 0.1240036 secs] 527181.835, 0.2068215 secs] 527914.287, 0.2884801 secs] 528457.134, 0.2548725 secs] I want to replace all the entries of "secs]" with just "secs" Thus, the output... (4 Replies)
Discussion started by: itzz.me
4 Replies

2. UNIX for Dummies Questions & Answers

Need help to escape special characters in Korn shell script

Hi, I would like to display the following message from my shell (Korn) script Copy "old_file.txt" to "new_file.txt" My code looks as follows print "Copy "old_file.txt" to "new_file.txt"" However, when I execute the script, I get the following output Copy old_file.txt to... (6 Replies)
Discussion started by: rogers42
6 Replies

3. Shell Programming and Scripting

sed with many special characters

I started with this: counter1=1 cp file.txt file_${counter1}.tmp while read name1 do echo $name1 counter2=`expr $counter1 + 1` sed /'${name1}'/d file_${counter1}.txt > file_${counter2}.txt counter1=`expr $counter1 + 1` done < source.txtsource.txt contains the... (1 Reply)
Discussion started by: lakanino
1 Replies

4. Shell Programming and Scripting

awk print $1 escape all special characters

I'm using awk '{print $1}' and it works most of the time to print the contents of a mysql query loop, but occationally I get a field with some special character in it, is there a way to tell awk to ignore all special characters between my FS? I have >186K records, so building a list of ALL special... (6 Replies)
Discussion started by: unclecameron
6 Replies

5. Shell Programming and Scripting

SED with Special characters

Hello All Seeking the right one SED command. My attempt is: From orginal.txt by SED to target.txt sed -i "/('outbound-callerid/a\$ext->add($context, $exten, '', new ext_SipAddHeader('P-Preferred-Identity', '<sip:${CALLERID(nummer)}@carrier.com>'));" orginal.txtWhat am make wrong?:wall: ... (5 Replies)
Discussion started by: mdbinder
5 Replies

6. Shell Programming and Scripting

Replace new line with <br /> & escape special characters

Hi, I wish to replace a new line with br (html) but it doesn't seem to work message=$(echo ${FORM_message} | tr '\r' '<br \/>' ) what it gives me seems to be ... b...? I am also having problem escaping hash sign in cut command: list=$(echo "$line" | cut -d'\#;\#' -f1) ; my intention is... (2 Replies)
Discussion started by: ted_chou12
2 Replies

7. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

8. Shell Programming and Scripting

Need help with sed to escape special characters

Hello Everyone, I need to read an encrypted password from the user and update that value in an xml file. I am trying to use "sed" for searching the appropriate tag and replacing this new value that get from the user. Since the encrypted password can contain special characters(like /,\,&,etc),... (4 Replies)
Discussion started by: majose
4 Replies

9. Shell Programming and Scripting

How to escape Special Characters in Expect programming?

Hi, I have written a unix expect utility "ssh-login.exp" which connects (ssh) to remote host and execute some shell script. I am calling this "ssh-login.exp" utility from another shell script. "ssh-login.exp" takes username, password, host and shell script path to execute on remote host. All... (1 Reply)
Discussion started by: Mahesh Desai
1 Replies

10. Shell Programming and Scripting

How to escape all special characters?

I have an application which I am integrating with that accepts the password via a CLI. I am running in to issues with passwords that contain special characters. I tried to escape them all, but I ran in to an issue where I cannot escape the characters ' ] My attempt is as follows: $... (2 Replies)
Discussion started by: AMG1978
2 Replies
Arch::RevisionBunches(3pm)				User Contributed Perl Documentation				Arch::RevisionBunches(3pm)

NAME
Arch::RevisionBunches - manage bunches of related revisions SYNOPSIS
use Arch::RevisionBunches; use Arch::Tree; my $rb = Arch::RevisionBunches->new; my $tree = Arch::Tree->new(".", own_logs => 1); $rb->add_revision_descs($tree->get_history_revision_descs); $rb->rebunch(25); # the default is 50 foreach my $bunch ($rb->get) { print "$bunch->{version} "; print " $_->{name} $_->{summary} " foreach @{$bunch->{revision_descs}}; } foreach my $bunch ($rb->reverse_revision_descs->rebunch(30)) { print $bunch->{name1}; print " .. $bunch->{name2}" if $bunch->{name2}; print " ($bunch->{daysago1}"; print " .. $bunch->{daysago2}" if $bunch->{name2}; print " days ago) "; } DESCRIPTION
This class helps front-ends to group revisions. Such grouping is essential when, for example, the version to be shown contains thousands of revisions. The front-end may decide to show expandable bunches of 100 revisions each. There is a support for revision descriptions (summary, date, creator, email, and in some cases associated the file name and/or the associated version). There is a constraint by convention, one bunch may only contain revisions of the same version, and the ones associated with the same file if applicable. It is possible to define an order of versions. It is possible to recreate bunches (rebunch) using a different number of revisions. The constraint defines the actual number of revisions in different bunches, it is not guaranteed to be the same. METHODS
The following methods are available: new, init, add_revision_descs, versions, rebunch, get, clear, reverse_revision_descs, versions, filepaths. new [%args] Construct Arch::RevisionBunches object. The %args are passed to init method. init [%args] The %args keys may be bunch_size (to use as the default bunch size instead of 50), max_sumlen (maximal summary length to keep including trailing ellipsis, must be greater than 5), version (if set, then all revisions are assumed to be of one version, otherwise multiple versions are assumed), final_revision and final_filepath (the final revision and filepath for which the revision bunches are constructed). These last two %args keys are not really used yet. add_revision_descs [%constant_fields] Add revision descriptions that is arrayref of hashes. See other classes that return such revision descriptions. If the %constant_fields is given, then add these to all revision descriptions (rarely needed). Return the object, this enables chaining of get or rebunch method call. rebunch [bunch_size] Group newly added revisions if no bunch_size is specified. Otherwise regroup all revisions using a given bunch_size. The default bunch size may be specified in the constructor. Return the same get does. get Return bunches that is arrayref in scalar context, array in list context. Each bunch is hashref with keys: revision_descs name1 daysago1 time1 tz1 name2 daysago2 time2 tz2 size num_creators num_other_creators main_creator main_email creator name date summary and optionally "version", "is_missing" and "filepath" if applicable. This method implicitly calls rebunch with no parameter if new revision descriptions were added that are not bunched yet. clear Clear all bunches and their revision descriptions. reverse_revision_descs Effectivelly empty all revision descriptions (both old and new) and readd them in the reverse order. Return the object, this enables chaining of get or rebunch method call. versions Return distinct versions participated in all bunches. Return empty arrayref if not applicable, i.e. if version is given in the constructor. filepaths Return distinct filepaths participated in all bunches. Return empty arrayref if not applicable, i.e. if revision descriptions have no filepath. BUGS
Waiting for your reports. AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). SEE ALSO
For more information, see Arch::Tree, Arch::Log, Arch::Session, Arch::Library. perl v5.10.1 2005-02-21 Arch::RevisionBunches(3pm)
All times are GMT -4. The time now is 12:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy