Remove text from String


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Remove text from String
# 8  
Old 09-24-2011
Now I got it:

Code:
var="Hello Bad World!"
newvar=$var | sed 's/Bad//'
echo "$newvar"

But it just displays a blank line Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove the text between all curly brackets from text file?

Hello experts, I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair. For ex: Input:- 59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5 Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies

2. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies

3. Shell Programming and Scripting

Remove not only the duplicate string but also the keyword of the string in Perl

Hi Perl users, I have another problem with text processing in Perl. I have a file below: Linux Unix Linux Windows SUN MACOS SUN SUN HP-AUX I want the result below: Unix Windows SUN MACOS HP-AUX so the duplicate string will be removed and also the keyword of the string on... (2 Replies)
Discussion started by: askari
2 Replies

4. Shell Programming and Scripting

Search a string in a text file and add another string at the end of line

Dear All I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies

5. Shell Programming and Scripting

Search a string in a text file and add another string at the particular position of a line

I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies

6. Shell Programming and Scripting

Remove multiple lines from a particular string to particular string

Hi, I have a file containing the DDLs of tables in a schema. From that I need to remove all the lines from a starting string till a specific string. Here is an example. File1.txt ------------- CREATE TABLE "SCHEMA1"."LKP11_TBL_USERS" ( "ID" NUMBER(8,0) NOT NULL ENABLE, "USER_ID"... (3 Replies)
Discussion started by: satyaatcgi
3 Replies

7. Shell Programming and Scripting

remove characters from string based on occurrence of a string

Hello Folks.. I need your help .. here the example of my problem..i know its easy..i don't all the commands in unix to do this especiallly sed...here my string.. dwc2_dfg_ajja_dfhhj_vw_dec2_dfgh_dwq desired output is.. dwc2_dfg_ajja_dfhhj it's a simple task with tail... (5 Replies)
Discussion started by: victor369
5 Replies

8. Shell Programming and Scripting

Remove duplicate files based on text string?

Hi I have been struggling with a script for removing duplicate messages from a shared mailbox. I would like to search for duplicate messages based on the “Message-ID” string within the messages files. I have managed to find the duplicate “Message-ID” strings and (if I would like) delete... (1 Reply)
Discussion started by: spangberg
1 Replies

9. UNIX for Dummies Questions & Answers

remove text from string

I use the following command to know the create table structure. mysqldump myDBName myTBName -d --compact And I get the following output... CREATE TABLE `tblThreads` ( `threadID` smallint(4) unsigned zerofill NOT NULL auto_increment, `threadTitle` varchar(255) NOT NULL default '',... (7 Replies)
Discussion started by: shantanuo
7 Replies

10. Shell Programming and Scripting

appending string to text file based on search string

Hi, I need to append string "Hi" to the beginning of the lines containing some specific string. How can I achieve that? Please help. Malay (1 Reply)
Discussion started by: malaymaru
1 Replies
Login or Register to Ask a Question
WA_KEYRING(1)							      WebAuth							     WA_KEYRING(1)

NAME
wa_keyring - WebAuth keyring manipulation tool SYNOPSIS
wa_keyring [--hv] -f file command [arg ...] wa_keyring -f keyring add valid-after wa_keyring -f keyring gc oldest-valid-after-to-keep wa_keyring -f keyring list wa_keyring -f keyring remove id DESCRIPTION
wa_keyring is a command line tool to manage WebAuth key ring files, which contain the private AES keys used by mod_webauth and mod_webkdc. It supports the following individual commands: add valid-after Adds a new key to the key ring. valid-after uses the format: nnnn[s|m|h|d|w] to indicate a time relative to the current time. The units for the time are specified by appending a single letter. That letter can be any of s, m, h, d, or w, which correspond to seconds, minutes, hours, days, and weeks respectively. For example: 10d is 10 days from the current time, and -60d is 60 days before the current time. gc oldest-valid-after-to-keep Garbage collects (removes) old keys on the key ring. Any keys with a valid-after date older then the specified time will be removed from the key ring. The format for oldest-valid-after-to-keep is the same as valid-after from the add command. Note that this means that times given to the gc command should generally be negative, to remove keys that have expired in the past. list Lists all the keys in the key ring. By default, a brief listing is used, but a verbose listing can be requested with the -v option. The following fields are present in a short listing: id The index/position of the key in the key ring. Created The date the key was created. Valid after The date at which the key becomes valid (in other words, the point at which the WebAuth server will start using it to encrypt and decrypt new data). Fingerprint The MD5 digest of the key data. Used to compare keys in two key rings. The following fields are present in the long listing: Key-Id The index/position of the key in the key ring. Created The date the key was created. Valid-After The date at which the key becomes valid (in other words, the point at which the WebAuth server will start using it to encrypt and decrypt new data). Key-Type The type of key. Currently, AES is the only supported key type. Key-Size Length in bytes of the key. Fingerprint The MD5 digest of the key data. Used to compare keys in two key rings. remove id Remove the key with ID id from the key ring. EXAMPLES
Add a key to the keyring valid as of the current time: wa_keyring -f keyring add 0d Add a key to the keyring that will be valid three days from now: wa_keyring -f keyring add 3d Remove keys from the key ring that became invalid more than 90 days ago: wa_keyring -f keyring gc -90d Remove the first key in the keyring. wa_keyring -f keyring remove 0 Display a verbose listing of all of the keys in the key ring: wa_keyring -f keyring -v list Note that a WebAuth server will normally manage its keyring file by itself, and wa_keyring is normally only used for debugging purposes. However, if you are setting up a load-balanced pool of servers that need to all share the same keys, turn off automatic keyring handling by putting the line: WebAuthKeyringAutoUpdate off to your Apache configuration, running a script periodically from cron on one server that does something like: wa_keyring -f keyring gc -90d wa_keyring -f keyring add 2d and then copying (in a secure manner!) the new keyring file to all of the other servers. AUTHOR
Roland Schemers <schemers@stanford.edu> 4.1.1 2012-04-25 WA_KEYRING(1)