Sponsored Content
Top Forums Shell Programming and Scripting Put parentheses around all capital letters using SED Post 302460683 by radoulov on Thursday 7th of October 2010 10:15:42 AM
Old 10-07-2010
Code:
sed 's/[[:upper:]]/(&)/g' infile

If your sed implementation doesn't support POSIX character classes,
you could use something like this:

Code:
sed 's/[A-Z]/(&)/g' infile

Some sed implementations support the -i option to edit the input file in-place,
with others you should use a temporary file.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

capital letters GONE!

I have an odd issue. I am trying to copy some files/folders to my linux box via a burned CD which I created on my mac. When I browse the files on the mac (or my windows box), everything looks fine (some of the folder names start with a capital letter, which is needed for everything to work... (8 Replies)
Discussion started by: blogg
8 Replies

2. UNIX for Advanced & Expert Users

look in file, seperate letters, put in order...

okay, I need some help! Im trying to write a script where it looks in the file you designate, pulls apart all the words so i can count how many of each letter there is in the file, then i need to put them in the order of the most occuring letter to the least. This most likley will need a loop... (3 Replies)
Discussion started by: chekeitout
3 Replies

3. Shell Programming and Scripting

capital sed

Hi everyone. I wanted to convert capital characters to small one. So i tried to use: sed -e "y///" but this won't work. And sed -e "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" this worked well. Does anyone know why?? (2 Replies)
Discussion started by: Euler04
2 Replies

4. Shell Programming and Scripting

Change a parameter to be in capital letters

Hi, I have a korn shell script with 1 parameter. My script deletes certain files, for example.... sid=$1 rm $ORC/dbs/orapwd${sid} #orapwddb1 rm $ORC/dbs/lk${sid} #lkDB1 In the first file, the $sid must be in small letters and in the second file, the $sid must be in capital... (4 Replies)
Discussion started by: n8575
4 Replies

5. Shell Programming and Scripting

change small letters to capital

hi guys, I know this might be very simple for u but not for me. I simply want to print the active users, changeing the first letter in their names to capital. i guess sed it's useful but don't know how to find the correspondign capital letter and don't know how to change just the first... (16 Replies)
Discussion started by: atticus
16 Replies

6. UNIX for Dummies Questions & Answers

How to search for capital letters

Hi, I just want to search a file for any words containng a capital letter and then display a list of just these words! I have been trying grep but to no has not helped.(im using the bash shell) (1 Reply)
Discussion started by: djdaniel3
1 Replies

7. Shell Programming and Scripting

changing all characters of a file to capital letters

Hi guys. I have file named output.txt containing file names. one per line. I use this command to convert all characters to capital letters and write to the same file. cat output.txt | tr 'a-z' 'A-Z' > output.txtBut at the end output.txt is emtpy. Could anyone help?? (6 Replies)
Discussion started by: majid.merkava
6 Replies

8. Shell Programming and Scripting

Sed command to replace with pattern except for text and closing parentheses

Can someone help me with a sed command: There will be multiple occurences in a file that look like this: MyFunction(12c34r5) and I need to replace that with just the 12c34r5 for every occurrence. The text between the parentheses will be different on each occurrence, so I can't search for that.... (4 Replies)
Discussion started by: missb
4 Replies

9. Solaris

Escape Sequence for Capital Letters Input at Shell Not Working

Hello, I am running Solaris 8. When issuing the command "stty lcase" all text which is output to the terminal are capitalized. Letters that are supposed to be capitals are preceded by a backslash during output. All text which is input is converted to lower case. This is the expected behaviour... (5 Replies)
Discussion started by: rstor
5 Replies

10. Shell Programming and Scripting

Organizing text file by Capital Names (capital word ' ' capital word)

Hi I have a file passwd_exmpl that contains: root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync... (5 Replies)
Discussion started by: eladage
5 Replies
LIBSKK(1)						      General Commands Manual							 LIBSKK(1)

NAME
skk - program that emulates Japanese SKK input method SYNOPSIS
skk [options] DESCRIPTION
skk is a tool that reads key sequences from the standard input and converts them to Japanese text according to a Japanese input method called SKK (Simple Kana to Kanji conversion program). More information about the SKK input method itself can be found at: http://openlab.jp/skk/ OPTIONS
The skk command follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -h, --help Show summary of options. -f, --file-dict=FILE Specify path to a file dictionary. -u, --user-dict=FILE Specify path to a user dictionary. -s, --skkserv=HOST:PORT Specify host and port running skkserv. -r, --rule=RULE Specify typing rule. -l, --list-rules List typing rules. EXAMPLE
echo "A i SPC" | skk Converts a capital letter "A" followed by lowercase letter "i" and a space. echo "K a p a SPC K a SPC" | skk Converts a capital letter "K" followed by lowercase letters "a", "p", "a", and a space. Then converts a capital letter "K" followed by "a" and a space. echo "r k" | skk -r tutcode Converts two lowercase letters "r" and "k" with TUT-Code typing rule. echo "a (usleep 50000) b (usleep 200000)" | skk -r nicola Converts two lowercase letters "a" and "b" typed with a 50000 micro seconds interval, and wait 200000 micro seconds, with NICOLA typing rule. AUTHOR
libskk was written by Daiki Ueno <ueno@unixuser.org>. 5 Jan 2012 LIBSKK(1)
All times are GMT -4. The time now is 10:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy