The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to separate values from a string ssuresh1999 UNIX for Dummies Questions & Answers 3 10-07-2008 12:23 PM
How to delete a particular string from different locations ? nani_ynm Shell Programming and Scripting 4 08-06-2008 02:49 AM
Catching ctrl-C or ctrl-D sendhilmani123 Shell Programming and Scripting 2 05-02-2006 05:02 PM
Disable ctrl-c,ctrl-d,ctrl-d in ksh script wtofu AIX 6 06-29-2005 04:41 PM
Using sed to delete a string? HowardIsHigh UNIX for Dummies Questions & Answers 1 06-19-2003 09:19 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-15-2008
balan_mca balan_mca is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
How to delete ctrl key values in a given string?

Hi all,

My query is... in the runtime, you are getting any input string. Unfortunately, you have pressed some ctrl keys or esc keys or arrow keys while typing input string. You can get the input value like that...
input string as
welcome^[[DtoB ngalore

So ,I want to remove those unwanted keys value...like that
Welcome to Bangalore

could you suggest me guys which unix commands I can use?

Thanx
Balan
  #2 (permalink)  
Old 10-15-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,953
remove everything except the alphabets

Code:
echo $input_string | sed 's/[^a-zA-Z]//g'
  #3 (permalink)  
Old 10-15-2008
balan_mca balan_mca is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
Hi,

echo $input_string | sed 's/[^a-zA-Z]//g'
if I use abu cmd... can get the following output only.

Welcome Dto BangaloreBABDDCCC

this removes only ^ [ ]  that chars.

i need exact string like Welcome to Bangalore

I tried already that cmd....thats y i confused

please clear my query yaar!
  #4 (permalink)  
Old 10-15-2008
balan_mca balan_mca is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
How to delete ctrl key values in a given string?

I thing, we have to find out key values. we can delete those key values if we found.

But how can we find those key values
  #5 (permalink)  
Old 10-16-2008
balan_mca balan_mca is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 15
Plz, anybody help me!
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0