Sponsored Content
Top Forums Shell Programming and Scripting Extract a substring using SED/AWK Post 302647343 by elixir_sinari on Monday 28th of May 2012 05:03:17 AM
Old 05-28-2012
Try

Code:
echo "XyZ[1.2.3]"|sed 's|\(.*\)\[\(.*\)\]|\1 \2|g'|read name version

This User Gave Thanks to elixir_sinari For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed, grep, awk, regex -- extracting a matched substring from a file/string

Ok, I'm stumped and can't seem to find relevant info. (I'm not even sure, I might have asked something similar before.): I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
Discussion started by: ropers
2 Replies

2. Shell Programming and Scripting

extract using sed/awk - need help? Please!!

Need help..not sure how to use with awk or sed I want to take data from the notification.$$ file and assign the data to variable "group". Not sure how to do it. The data I want to extract from the notification.$$ is on the first line of the file ..right after the (notice): NetWorker... (5 Replies)
Discussion started by: gzs553
5 Replies

3. Shell Programming and Scripting

Using Awk in shell script to extract an index of a substring from a parent string

Hi All, I am new to this shell scripting world. Struck up with a problem, can anyone of you please pull me out of this. Requirement : Need to get the index of a substring from a parent string Eg : index("Sandy","dy") should return 4 or 3. My Approach : I used Awk function index to... (2 Replies)
Discussion started by: sandeepms17
2 Replies

4. Shell Programming and Scripting

Sed extract substring on (OS X)

On OS 10.4.11 I have filenames like: 670711 SA T2 v1-1_DS_EF.doc CT_670520 AM T1 v1-2_DS_EF.doc CT_670716 - 2 SA T4 v1-2_DS_EF.doc CT_670713 SA T3 v1-1_DS_EF.doc 670421 PA DYP1 v1-1_DS_EF.doc CT_670425 PA DYP2 v1-1_DS_EF.doc CT_670107 RA T3 v1-2_DS_EF.doc CT_670521 AM T2 v1-2_DS_EF.doc... (3 Replies)
Discussion started by: mlommel
3 Replies

5. Shell Programming and Scripting

Extract some characters with SED or AWK

Hi, I have the following example string: today_is_a_good_day.txt The character "_" inside the string can sometimes be more or less. The solution for every string equal the count of "_" should be alway the rest after the last underline character. Result: day.txt I want to use awk... (5 Replies)
Discussion started by: climber
5 Replies

6. UNIX for Dummies Questions & Answers

Using sed to extract a substring at end of line

This is the line that I am using: sed 's/^*\({3}*$\)/\1 /' <test.txt >results.txt and suppose that test.txt contains the following lines: http://www.example.com/200904/AUS.txt http://www.example.com/200903/_RUS.txt http://www.example.com/200902/.FRA.txt What I expected to see in results.txt... (6 Replies)
Discussion started by: figaro
6 Replies

7. Shell Programming and Scripting

Substring using sed or awk

I am trying to get a substring from a string stored in a variable. I tried sed with a bit help from this forum, but not successful. Here is my problem. My string is: "REPLYFILE=myfile.txt" And I need: myfile.txt (everything after the = symbol). My string is: "myfile.txt.gz.20091120.enc... (5 Replies)
Discussion started by: jamjam10k
5 Replies

8. Shell Programming and Scripting

Substring using cut/awk/sed

Hi Gurus,I have a seemingly simple problem but struggling with it.It is as follows : I/p string - ABCDEFGHIJ20100909.txt desired o/p - AB,DEF,20100909,ABCDEFGHIJ20100909.txt How to achieve it ?Thanks in advance. Please use code tags, thank you (20 Replies)
Discussion started by: sumoka
20 Replies

9. Shell Programming and Scripting

Using sed, awk or perl to remove substring of all lines except the first

Greetings All, I would like to find all occurences of a pattern and delete a substring from the all matching lines EXCEPT the first. For example: 1234::group:user1,user2,user3,blah1,blah2,blah3 2222::othergroup:user9,user8 4444::othergroup2:user3,blah,blah,user1 1234::group3:user5,user1 ... (11 Replies)
Discussion started by: jacksolm
11 Replies

10. Shell Programming and Scripting

Awk/sed HTML extract

I'm extracting text between table tags in HTML <th><a href="/wiki/Buick_LeSabre" title="Buick LeSabre">Buick LeSabre</a></th> using this: awk -F "</*th>" '/<\/*th>/ {print $2}' auto2 > auto3 then this (text between a href): sed -e 's/\(<*>\)//g' auto3 > auto4 How to shorten this into one... (8 Replies)
Discussion started by: p1ne
8 Replies
rel(5)								       Files								    rel(5)

NAME
rel - Release resource file DESCRIPTION
The release resource file specifies which applications are are included in a release (system) based on Erlang/OTP. This file is used by the functions in systools when generating start scripts ( .script , .boot ) and release upgrade files ( relup ). FILE SYNTAX
The release resource file should be called Name.rel . The .rel file contains one single Erlang term, which is called a release specification . The file has the following syntax: {release, {RelName,Vsn}, {erts, EVsn}, [{Application, AppVsn} | {Application, AppVsn, Type} | {Application, AppVsn, IncApps} | {Application, AppVsn, Type, IncApps}]}. * RelName = string() is the name of the release. * Vsn = string() is the version of the release. * EVsn = string() is the version of ERTS the release is intended for. * Application = atom() is the name of an application included in the release. * AppVsn = string() is the version of an application included in the release. * Type = permanent | transient | temporary | load | none is the start type of an application included in the release. If Type = permanent | transient | temporary , the application will be loaded and started in the corresponding way, see applica- tion(3erl) . If Type = load , the application will only be loaded. If Type = none , the application will be neither loaded nor started, although the code for its modules will be loaded. Defaults to permanent * IncApps = [atom()] is a list of applications that are included by an application included in the release. The list must be a subset of the included applications specified in the application resource file ( Application.app ) and overrides this value. Defaults to the empty list. Note: The list of applications must contain the kernel and stdlib applications. SEE ALSO
application(3erl), relup(5), systools(3erl) Ericsson AB sasl 2.1.9.3 rel(5)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy