Sponsored Content
Top Forums Shell Programming and Scripting replace first character of string sed Post 302130158 by kahuna on Friday 3rd of August 2007 09:32:38 AM
Old 08-03-2007
Code:
$echo test | perl -pe 's/^(.{0})(.)/$1\U$2/;'
Test
$echo test | perl -pe 's/^(.{1})(.)/$1\U$2/;'
tEst
$echo test | perl -pe 's/^(.{2})(.)/$1\U$2/;'
teSt
$echo test | perl -pe 's/^(.{3})(.)/$1\U$2/;'
tesT

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find and replace character in a string

Hi all, My problem is the following: I've a script that must list all files in a directory and write this information in a text file. I've tried to get the list through ls command and then write it using msgecho msgecho "`ls $PATH_APS_JOB_ORA`" This works good but the created string... (7 Replies)
Discussion started by: callimaco0082
7 Replies

2. Linux

How to replace the 2nd character in a string using sed?

Hi, i have string var1=NN. Based on conditions, i have to change this first N to Y or second N to Y and send the details to other process. How to do that? This is a linux machine. Thanks, Selva (1 Reply)
Discussion started by: bharathappriyan
1 Replies

3. Shell Programming and Scripting

In Sed how can I replace starting from the 7th character to the 15th character.

Hi All, Was wondering how I can do the following.... I have a String as follows "ACCTRL000005022RRWDKKEEDKDD...." This string can be in a file called tail.out or in a Variable called $VAR2 Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Discussion started by: mohullah
5 Replies

4. Shell Programming and Scripting

replace character from string

I have a string ----- i want to replace the 3rd '-' with a character How can i do that Basically im trying to do hangman I have added the '-----' string to a file called hash and i have the character in a variable called $input also i have the character location(index) in this variable... (12 Replies)
Discussion started by: omaral
12 Replies

5. Shell Programming and Scripting

Replace character in certain position in a string

Hello everyone this is my first post of many to come :) I am writing a script and in this script at one point i need to replace a character in a particular position in a string for example: in the string "mystery" i would need to replace the 3rd position to an "r" so the string becomes... (3 Replies)
Discussion started by: snipaa
3 Replies

6. Shell Programming and Scripting

replace a character in a string-help please

I have a string eg. word=promise and I have the masked version of the word which is -------(7dash for each character) if the user input a character O, I want the masked version of the word to be --o---- if the user inputs another character p, then the masked word becomes p-o---- How can i... (1 Reply)
Discussion started by: rajugurung
1 Replies

7. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

8. Shell Programming and Scripting

How to replace with a special character in String

Hi, I am beginner to Shell Scripting. I have a String like this "testabcdef", i need the first character as it is and the remaining character should be replaced by the the '*' character. e.g(t***********) PLZ Suggest me. (5 Replies)
Discussion started by: nanthagopal
5 Replies

9. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies
VDAAERL(1)						    Voicetronix Telephony Tools 						VDAAERL(1)

NAME
vdaaerl - Measure the echo-return loss on Voicetronix FXO telephony modules SYNOPSIS
vdaaerl [options] DESCRIPTION
The vdaaerl utility tests the echo-return from a telephone line connected to a Voicetronix FXO module, such as those used on the OpenPCI range of cards. It can scan all available impedance values to find the best match for a particular line. It will wait for an incoming call on the port under test. The calling handset should have the microphone well muted for the duration of the test. A series of tones will be played down the line to determine the ERL in several parts of the audio spectrum. You should avoid creating any other noise on the line while this test is running, or the results may be skewed. If no --impedance is specified, and the --scan option is not used, then the default impedance value (based on the port's country selection) will be used. OPTIONS
The following options are available: --help, -? Show summary of options. --card number Explicitly select the card to test. Default is card 0. --port number Explicitly select the port to test. Default is port 0 of the card being tested. --impedance number Test a particular impedance setting [0 - 15]. --scan Test all available impedances. --playgain db Set the hardware play gain. Values may range from -12.0 to 12.0. --recgain db Set the hardware record gain. Values may range from -12.0 to 12.0. SEE ALSO
proslicerl(1) AUTHOR
Ron Lee, Peter Wintulich, David Rowe, Voicetronix <support@voicetronix.com.au> This manual page was written by Ron <ron@debian.org>, for the Debian project (but may be used by others). VPB driver package Oct 11, 2007 VDAAERL(1)
All times are GMT -4. The time now is 05:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy