Sponsored Content
Top Forums Shell Programming and Scripting Replace apostrophe with backslash apostrophe Post 302529133 by bartus11 on Wednesday 8th of June 2011 03:24:48 PM
Old 06-08-2011
I think shell needs its backslashes because of the use of double quotes for sed code.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to strip apostrophe from a file

I am trying to remove or replace various extraneous characters from a file so that subsequent processes work correctly. The characters that is giving me trouble is the apostrophe '. The command I 'm trying is sed 's/\'//g' ${IN_WRK_DIR}/file1 > ${IN_WRK_DIR}/file2 in a Korn script on HP... (8 Replies)
Discussion started by: aquimby
8 Replies

2. Shell Programming and Scripting

Escaping apostrophe using shell script

Hi, I am using the KSH shell. I am facing a problem of escaping apostrophe('), that is occuring in a variable. I used the following command, but in vain item=`echo $item|sed 's/'/\'/g'` this code replaces the occurance of ' in an xml file to apostrophe(') symbol. The output of... (2 Replies)
Discussion started by: mradul_kaushik
2 Replies

3. Shell Programming and Scripting

inserting an apostrophe into awk output

hello, I have a simple awk script thus: egrep populateNode logfile.txt | gawk '{print $11}' This gives me a list of usernames. I want to pipe the above command into another command that will surround each username with an SQL insert statement: insert into thetable (username) values... (3 Replies)
Discussion started by: tenakha
3 Replies

4. UNIX for Dummies Questions & Answers

How to replace special chars like " ' " (Apostrophe)

I'm goin to drive crazy soon, if i can not do this. I have a text file (570kb) and i have to replace the apostrophe " ' " and minus "-" with space " ". i have done it for minus: sed 's/-/ /g' aaa.txt >zzz.txt this replaced minus with space. but i can not use the same command for ' . ... (4 Replies)
Discussion started by: onculo
4 Replies

5. Shell Programming and Scripting

script to replace a character with '(Apostrophe)

Hi Friends, I need a sed or awk based script to replace a character(alphabet) with ' (Apostrophe). I tried to use the following two commands 1) sed -e 's/a/'/' filename 2) awk '{sub("a","'",$1);print}' filename but both got failed. Any help on this. Thanks in advance.. (3 Replies)
Discussion started by: ks_reddy
3 Replies

6. Shell Programming and Scripting

Perl - Title Case after apostrophe

I've got: $string =~ s/(\w+)/\u\L$1/g; Which capitalizes each word in the string. The problem is if I have a string with an apostrophe the first letter after it gets capitalized as well. So Bob's becomes Bob'S. Thanks for any quick fixes! (4 Replies)
Discussion started by: mjmtaiwan
4 Replies

7. Programming

How to change only one occurance of apostrophe with sed

Hi, I have a document with usual English text and some of the words have apostrophes (e.g. don't, can't, etc.) I would like all these apostrophes to be doubled (e.g. don''t, can''t, etc.), but the problem is, that some of such words have double apostrophe and by using sed -i "s/'/''/g"... (2 Replies)
Discussion started by: neptun79
2 Replies

8. Shell Programming and Scripting

Remove apostrophe and a letter followed by it

Hi All, For example, I have some words like these: cabinet's school's field's you'll I know how to remove apostrophe from these words using this command: cat filename | tr -s "\'" ' ' But I am not sure how I can remove the letter followed by the apostrophe, so that my output... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

9. Shell Programming and Scripting

Add backslash and apostrophe to string in variable.

Hi All I want to add backslash and apostrophe to variable in my bash script. I have my variable: USER_LIST=USER1,USER2,USER3 and I want something like this: USER_LIST_DEL=/'USER1/',/'USER2/',/'USER3/' any ideas ?? (1 Reply)
Discussion started by: primo102
1 Replies

10. UNIX for Beginners Questions & Answers

Find ' (apostrophe) by grep

hi linux expert how can i find apostrophe (') symbol in text file by grep? for example for find 'test, the command grep " \'test" * is not useful. Many Thanks samad (1 Reply)
Discussion started by: abdossamad2003
1 Replies
deroff(1)							   User Commands							 deroff(1)

NAME
deroff - remove nroff/troff, tbl, and eqn constructs SYNOPSIS
deroff [ -m [m | s | l] ] [-w] [-i] [ filename...] DESCRIPTION
deroff reads each of the filenames in sequence and removes all troff(1) requests, macro calls, backslash constructs, eqn(1) constructs (between .EQ and .EN lines, and between delimiters), and tbl(1) descriptions, perhaps replacing them with white space (blanks and blank lines), and writes the remainder of the file on the standard output. deroff follows chains of included files (.so and .nx troff commands); if a file has already been included, a .so naming that file is ignored and a .nx naming that file terminates execution. If no input file is given, deroff reads the standard input. OPTIONS
-m The -m option may be followed by an m, s, or l. The -mm option causes the macros to be interpreted so that only running text is output (that is, no text from macro lines.) The -ml option forces the -mm option and also causes deletion of lists associated with the mm macros. -w If the -w option is given, the output is a word list, one ``word'' per line, with all other characters deleted. Otherwise, the output follows the original, with the deletions mentioned above. In text, a ``word'' is any string that contains at least two let- ters and is composed of letters, digits, ampersands (&), and apostrophes ('); in a macro call, however, a ``word'' is a string that begins with at least two letters and contains a total of at least three letters. Delimiters are any characters other than letters, digits, apostrophes, and ampersands. Trailing apostrophes and ampersands are removed from ``words.'' -i The -i option causes deroff to ignore .so and .nx commands. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWdoc | +-----------------------------+-----------------------------+ SEE ALSO
eqn(1), nroff(1), tbl(1), troff(1), attributes(5) NOTES
deroff is not a complete troff interpreter, so it can be confused by subtle constructs. Most such errors result in too much rather than too little output. The -ml option does not handle nested lists correctly. SunOS 5.10 14 Sep 1992 deroff(1)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy