Sponsored Content
Top Forums Shell Programming and Scripting Deleting part of a string enclosed in brackets Post 302338791 by edidataguy on Wednesday 29th of July 2009 12:52:53 AM
Old 07-29-2009
Quote:
Originally Posted by lathavim
See if this works.



Code:
 
 sed -e '1d' -e '/@executable_path/d'  filename | cut -d " " -f1

A small refinement, just one sed command is enough:
Code:
sed '1d; /@executable_path/d; s/\(^[^ ]*\) .*$/\1/' filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

substitution of string in brackets

Hi friends! I have a tab delimited file with two columns : GB_45_DRB SP:0139466(mrmi sisignm)|SP:3674(fllflg_itoioh)|SP:68954779(RMTKLGF to emmdm-roomto) GB_45_DRD SP:475928(mgmdksi rikgkg)|SP:587959(roykgl tiic-tm)|SP:0139466(mrmi sisignm)|SP:3674(fllflg_itoioh)|SP:68954779(RMTKLGF to... (4 Replies)
Discussion started by: jacks
4 Replies

2. Shell Programming and Scripting

How to substitute brackets in the beginning of string in perl?

Hi, I have a string like this user can specify different query sets that is why "or" is mentioned: $string="]("; or $string="](("; or $string="]((("; or $string="]((((("; (1 Reply)
Discussion started by: vanitham
1 Replies

3. UNIX for Advanced & Expert Users

grep string containing [] brackets

Hello, I am trying to grep string with square brackets. for example I want to grep the below string in log.txt file. This is a test thanks in advance. (2 Replies)
Discussion started by: sureshcisco
2 Replies

4. UNIX for Dummies Questions & Answers

Deleting part of file names

My server got messed up and the names of my files were not completely processed. As results I ended up getting a bunch of files with the following names: I need to remove the underscore and everything before it. Thus, the files will be renamed to something like this: Any help will be greatly... (3 Replies)
Discussion started by: Xterra
3 Replies

5. Shell Programming and Scripting

Deleting part of a string : string manipulation

i have something like this... echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }' Certifica the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it. expected output is Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies

6. Homework & Coursework Questions

Sed, matching nested brackets and deleting

1. The problem statement, all variables and given/known data: I have to write a script using sed, which delete everything between curly brackets and the brackets themself. The brackets might be nested. The input-file is: aaa { bbb ccc { ddd eee } fff { ... (2 Replies)
Discussion started by: FuzzyGnome
2 Replies

7. Shell Programming and Scripting

How to delete a column/columns of a CSV file which has cell values with a string enclosed in " , "?

How can I delete a column from a CSV file which has comma separated value with a string enclosed in double quotes and a comma in between? I have a file 44.csv with 4 lines including the header like the below format: column1, column2, column3, column 4, column5, column6 12,455,"string with... (6 Replies)
Discussion started by: dhruuv369
6 Replies

8. Shell Programming and Scripting

How to delete the commas in a .CSV file that are enclosed in a string with double quotes?

Okay, I would like to delete all the commas in a .CSV file (TEST.CSV) or at least substitute them with empty space, that are enclosed in double quote. Please see the sample file as below: column 1,column 2,column 3,column 4,column 5,column 6,column 7,column 8,column 9,column 10... (8 Replies)
Discussion started by: dhruuv369
8 Replies

9. Shell Programming and Scripting

How to delete a columns of a CSV file which has cell values with a string enclosed in " , "?

Hi How can I delete a columns from a CSV file which has comma separated value with a string enclosed in double quotes or square bracket and a comma in between? I have a csv file with below format. Template,Target Server,Target Component,Rule Group,Rule,Rule Reference Number,Rule... (7 Replies)
Discussion started by: Litu19
7 Replies

10. Shell Programming and Scripting

Issue catching/reading 2 digits and 3 letter string between brackets

Hello I'm writing a handler for ffmpeg, and having troubles to catch some exceptions that may occour with certain files. In order to parse for video & subtitle maps, i've had to make the raw data easier to handle, until now this worked well, but basicly i've just been lucky... The input... (1 Reply)
Discussion started by: sea
1 Replies
OTOOL(1)						      General Commands Manual							  OTOOL(1)

NAME
otool - object file displaying tool SYNOPSIS
otool [ option ... ] [ file ... ] DESCRIPTION
The otool command displays specified parts of object files or libraries. If the, -m option is not used, the file arguments may be of the form libx.a(foo.o), to request information about only that object file and not the entire library. (Typically this argument must be quoted, ``libx.a(foo.o)'', to get it past the shell.) Otool understands both Mach-O (Mach object) files and fat file formats. Otool can display the specified information in either its raw (numeric) form (without the -v flag), or in a symbolic form using macro names of con- stants, etc. (with the -v or -V flag). At least one of the following options must be specified: -a Display the archive header, if the file is an archive. -S Display the contents of the `__.SYMDEF' file, if the file is an archive. -f Display the fat headers. -h Display the Mach header. -l Display the load commands. -L Display the names and version numbers of the shared libraries that the object file uses. -D Display just install name of a shared library. -s segname sectname Display the contents of the section (segname,sectname). If the -v flag is specified, the section is displayed as its type, unless the type is zero (the section header flags). Also the sections (__OBJC,__protocol), (__OBJC,__string_object) and (__OBJC,__run- time_setup) are displayed symbolically if the -v flag is specified. -t Display the contents of the (__TEXT,__text) section. With the -v flag, this disassembles the text. And with -V, it also symboli- cally disassembles the operands. -d Display the contents of the (__DATA,__data) section. -o Display the contents of the __OBJC segment used by the Objective-C run-time system. -r Display the relocation entries. -c Display the argument strings (argv[] and envp[]) from a core file. -I Display the indirect symbol table. -T Display the table of contents for a dynamically linked shared library. -R Display the reference table of a dynamically linked shared library. -M Display the module table of a dynamically linked shared library. -H Display the two-level namespace hints table. The following options may also be given: -p name Used with the -t and -v or -V options to start the disassembly from symbol name and continue to the end of the (__TEXT,__text) sec- tion. -v Display verbosely (symbolically) when possible. -V Display the disassembled operands symbolically (this implies the -v option). This is useful with the -t option. -X Don't display leading addresses when displaying contents of sections. -arch arch_type Specifies the architecture, arch_type, of the file for otool(1) to operate on when the file is a fat file. (See arch(3) for the currently know arch_types.) The arch_type can be "all" to operate on all architectures in the file. The default is to display only the host architecture, if the file contains it; otherwise, all architectures in the file are shown. -m The object file names are not assumed to be in the archive(member) syntax, which allows file names containing parenthesis. Apple Computer, Inc. April 30, 2002 OTOOL(1)
All times are GMT -4. The time now is 05:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy