Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trimming a string based on delimiter. Post 302582518 by balajesuri on Friday 16th of December 2011 08:33:51 AM
Old 12-16-2011
Code:
[root@hostname test]# cat test.sh
#! /bin/bash
echo $1 | sed "s/$1/Cluster/"

[root@hostname test]# ./test.sh whateverCluster
Cluster

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trimming a string

Hi, I am trying to find a script command that will let me trim leading and trailing space from a string. I have coded a SQL Select and sending the output to a file. Later I am parsing the file and reading each field. The problem is that each field uses the same size as the DB2 type it was defined... (2 Replies)
Discussion started by: fastgoon
2 Replies

2. Shell Programming and Scripting

Substring based on delimiter, finding last delimiter

Hi, I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies

3. Shell Programming and Scripting

Trimming sequences based on specific pattern

My files look like this And I need to cut the sequences at the last "A" found in the following 'pattern' -highlighted for easier identification, the pattern is the actual file is not highlighted. The expected result should look like this Thus, all the sequences would end with AGCCCTA... (2 Replies)
Discussion started by: Xterra
2 Replies

4. Shell Programming and Scripting

Trimming sequences based on Reference

My file looks something like this Wnat I need is to look for the Reference sequence (">Reference1") and based on the length of that sequence trim all the entries in that file. So, the rersulting file will contain all sequences with the same length, like this Thus, all sequences will keep... (5 Replies)
Discussion started by: Xterra
5 Replies

5. Shell Programming and Scripting

split record based on delimiter

Hi, My inputfile contains field separaer is ^. 12^inms^ 13^fakdks^ssk^s3 23^avsd^ 13^fakdks^ssk^a4 I wanted to print only 2 delimiter occurence i.e 12^inms^ 23^avsd^ (4 Replies)
Discussion started by: Jairaj
4 Replies

6. Shell Programming and Scripting

Trimming a string

Hi I need to trim white spaces from strings in a file. Input file is like this: 1_rrc_CatalogGroups.csv = 607 1_rrc_Sales_TopCatalogGroups.csv = 4 1_rrc_Sales_CatalogEntries_CatalogGroup_Rel.csv = 7 Need to trim space before and after = symbol. This is my script: #!/usr/bin/ksh ... (2 Replies)
Discussion started by: sukhdip
2 Replies

7. UNIX for Dummies Questions & Answers

awk for trimming a string up to the first, then second, then third... match

Hi ! With awk, I would need to trim a string from the beginning up to the first occurrence of "1", then from the beginning up to the second occurrence of "1", then from the beginning up to the third, then the fourth...., then the last occurrence of "1". input: 1aaa1bb1ccccccc dd1e1ffff... (7 Replies)
Discussion started by: beca123456
7 Replies

8. Shell Programming and Scripting

Separate string based on delimiter

Hi, for fd in $(grep "/tmp/" hello.properties)The grep gives me the below output: deploydir=/tmp/app1/dfol prodir= /tmp/hello/prop ...... Now i want to store /tmp/app1/dfol then /tmp/hello/prop in a variable so that i can check if those folders files exists or not. The delimiter would... (4 Replies)
Discussion started by: mohtashims
4 Replies

9. Shell Programming and Scripting

How to separate based on delimiter?

Hi, Variable=MKT1,MKT2,MKT3 and so on i am trying to seperate MKT1,MKT2,MKT3 and store each in a variable. the values in variable1 may vary. I am using bash (8 Replies)
Discussion started by: arghadeep adity
8 Replies

10. UNIX for Dummies Questions & Answers

Splitting strings based on delimiter

i have a snippet from server log delimited by forward slash. /a/b/c/d/filename i need to cut until last delimiter. So desired output should look like: /a/b/c/d can you please help? Thanks in advance. (7 Replies)
Discussion started by: alpha_1
7 Replies
ldns-test-edns(1)					      General Commands Manual						 ldns-test-edns(1)

NAME
ldns-test-edns - test if dns cache supports EDNS and DNSSEC. SYNOPSIS
ldns-test-edns [ -i ] { ip } DESCRIPTION
ldns-test-edns tests a DNS cache and checks if it supports EDNS0 and DNSSEC types so that it can be used as a dnssec-enabled DNS cache. It sends two queries to the cache, one for the root key and one for a DS record. These must succeed, the answer must have EDNS, that type and signatures. If the IP address is good for DNSSEC, it is printed with 'OK'. Otherwise short description is given of the failure. If OK is given, the cache should be good to use as a cache for a local configured DNSSEC validator. The tool assumes the root is signed and Sweden is signed. Also, the queries are sent with the CD flag, the tool does not check that the results are validated, but that they can be validated. OPTIONS
-i option enables a mode where the working IP addresses are printed after another, with no other explanations, and if none work or no IP addresses are on the input, 'off' is printed. ldns-test-edns takes one or more IP addresses, it checks them in turn. IPv4 and IPv6 addresses can be given. The exit value is for the last checked IP address: 0 is OK, 1 is failure, 2 is some sort of network failure. AUTHOR
Written by the ldns team as an example for ldns usage. REPORTING BUGS
Report bugs to <ldns-team@nlnetlabs.nl>. COPYRIGHT
Copyright (C) 2010 NLnet Labs. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. 14 Dec 2010 ldns-test-edns(1)
All times are GMT -4. The time now is 05:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy