10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
2. UNIX for Beginners Questions & Answers
Hello,
I have never ever seen below notation for string substitution.
sed -i -e 's/tttt/pppp'/g /var/bin/czech.sh;
The strange thing for me is the position of the apostrophe. Should it be before the / or after the g?
If I had been writing that command line, I would have chosen below way:... (3 Replies)
Discussion started by: baris35
3 Replies
3. Shell Programming and Scripting
Hi,
I have this text file with these words and I need help with removing words with repeated letter from these lines.
1 ama
5 bib
29 bob
2 bub
5 civic
2 dad
10 deed
1 denned
335 did
1 eeee
1 eeeee
2 eke
8... (4 Replies)
Discussion started by: crepe6
4 Replies
4. Shell Programming and Scripting
Good afternoon all,
I want to ask how to change some letter in my file with other letter in spesific line
eg.
data.txt
1
1
1
0
0
0
0
for example i want to change the 4th line with character 1.
How could I do it by SED or AWK.
I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies
5. Shell Programming and Scripting
I have a file:
575G /local/mis/SYBDUMP
I want to remove the G, K, M or T so I can use $1 in awk or sed to do math.
I want to end up with a file containing:
575 /local/mis/SYBDUMP
It should not matter how small or large the numeric numbers are so if 2, 3, 4, or 5 digits etc I want to see... (9 Replies)
Discussion started by: tamvgi
9 Replies
6. Shell Programming and Scripting
I'm coding using BASH and have a requirement to replace apostrophes with backslash apostrophes. For example below:
I am here 'in my room' ok
Would be changed to:
I am here /'in my room/' ok
The original text is coming from a field in a MySql database and is being used by another process that... (5 Replies)
Discussion started by: dbjock
5 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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