Sponsored Content
Top Forums Shell Programming and Scripting sed: how to replace regex with a ' (quote) mark Post 302340961 by danmero on Tuesday 4th of August 2009 07:21:53 PM
Old 08-04-2009
Code:
# echo 'foo"bar' | sed s/\"/\'/
foo'bar

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

single or double quote in SED

i m trying the following command but its not working: sed 's/find/\'replace\'/g' myFile but the sed enters into new line # sed 's/find/re\'place/g' myFile > I havn't any idea how to put single quote in my replace string. Your early help woud be appreciated. Thanx (2 Replies)
Discussion started by: asami
2 Replies

2. Shell Programming and Scripting

How to get rid of double quote in sed.

Hi, i am using sed command to grep just a valuable data for my report generating. Thanks to the person who assists me on before thread. the problem that i encounter now is when i executed below command The output will give me like below output in between the data, there is a double quote. How... (6 Replies)
Discussion started by: anakiar
6 Replies

3. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

4. Shell Programming and Scripting

Replace a string in quote to uppercase

Hi, I need to find all strings in single quote and change the case of the string to UPPER. Example: Input: xyz abc ccc 'zxxx7U' dfsdf sdfdd aaa 'oR77' and 'or88' Output: xyz abc ccc 'ZXXX7U' dfsdf sdfdd aaa 'OR77' and 'OR88' Appreciate your help!! Thanks Selva (6 Replies)
Discussion started by: selkum
6 Replies

5. Shell Programming and Scripting

replace a single quote using sed command.

Hi, How do I replace the charachters = '*' to = '^' using Sed commands. As I have several * in the script, thus I have to replace the single quotes too. Please let me know any solution. I have tried the escape character backslash '\' but it doesnt help. sed "s/= \'*\'/=... (2 Replies)
Discussion started by: prachifun
2 Replies

6. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

7. UNIX for Dummies Questions & Answers

find single quote in a string and replace it

Hi, I have variable inside shell script - from_item. from_item = 40.1'1/16 i have to first find out whether FROM_ITEM contains single quote('). If yes, then that need to be replace with two quotes (''). How to do it inside shell script? Please note that inside shell script........ (4 Replies)
Discussion started by: yogichavan
4 Replies

8. Shell Programming and Scripting

Expanding regex in quote

Hi Experts, I'm trying to match and perform the substitution (below) but failed. <File1> Attributes = "SampleAttributes" Attributes1 = "SampleAttributes1" Command: grep Attributes File1 | sed 's|Attributes\s=\s\"\"|Attributes = \"ReplaceAttributes\"|' Any ideas? :( (2 Replies)
Discussion started by: antderu
2 Replies

9. Shell Programming and Scripting

How to replace quote symbol(") and dot(.) with some other values!!

Hi , I have below input file 1.order number is useful. 2.vendor_id is produced. 3.the vandor name is "malawar". I want output file like 1. order number is useful. 2. vendor_id is produced. 3. the vandor name is VmalawarV. in input file line number 1.order number there is no... (4 Replies)
Discussion started by: vinothsekark
4 Replies

10. Shell Programming and Scripting

Replace HTML tags using sed regex

I need all the end tags of </font> to be replaced with new line yet enclosing tag to be retained </font>. Please help me in this regard. Input: <font>abc</font>def<font>ghi</font> Output: <font>abc</font> def <font>ghi</font> (3 Replies)
Discussion started by: Badhrish
3 Replies
dbar(1) 							   User Commands							   dbar(1)

NAME
dbar - ASCII progresbar SYNOPSIS
echo <percentage> | dbar [options] <indicator text> DESCRIPTION
dbar lets you define static 0% and 100% marks or you can define these marks dynamically at runtime. Static and dynamic marks can be mixed, in this case the value specified at runtime will have a higher priority. You can specify ranges of numbers, negative, positive or ranges with a negative min value and positive max value. All numbers are treated as double precision floating point, i.e. the input is NOT limited to integers. OPTIONS
-l Label to be prepended to the bar (default: "" ). -nonl no new line, don't put ' ' at the end of the bar (default: do print " ") -max Value to be considered 100% (default: 100). -min Value to be considered 0% (default: 0). -s Symbol represeting the percentage value in the meter (default: "="). -w Number of charcaters to be considered 100% in the meter (default: 25) EXAMPLES
Static 100% mark or single value input: echo 25 | dbar -max 100 -l text Output: text 25% [====== ] If your 100% mark changes dynamically or 2-values input: echo "50 150" | dbar | | | |__ max value | |__ value to display Output: 33% [======== ] If your value range is not between [0, maxval] or 3-values input: echo "50 -25 150" | dbar | | | | | |__ max value 100% mark | | | |_____ min value 0% mark | |________ value to display Output: 43% [=========== ] Multiple runs: for i in 2 20 50 75 80; do echo $i; sleep 1; done | dbar | dzen2 Output: Find out yourself. ENVIRONMENT
None. FILES
None. SEE ALSO
dzen2(1) AUTHORS
Program was written by Robert Manea <rob.manea@gmail.com>. This manual page was written by Jari Aalto <jari.aalto@cante.net> for the Debian GNU system (but may be used by others). Released under license GNU GPL version 2 or (at your option) any later version. For more information about license, visit <http://www.gnu.org/copyleft/gpl.html>. dbar 2012-04-02 dbar(1)
All times are GMT -4. The time now is 08:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy