Sponsored Content
Top Forums Shell Programming and Scripting extract/select pattern from input Post 302247110 by summer_cherry on Wednesday 15th of October 2008 02:55:45 AM
Old 10-15-2008
Code:
sed 's/\(.*\)\(\/.*\)/\1/' filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

select datas from an input file

I have a file containing a list of references and I want to run a script that will make the same action for each reference. The input file changes every hour, it's why I want to use a script that can read in a file, record by record, and run a specific action for the reference readed. Thanks... (1 Reply)
Discussion started by: dde
1 Replies

2. Shell Programming and Scripting

Select everything before a pattern

Hi I have i doubt, actually i have to select everything before a word(pattern).For that i am using sed i am using the below line of code but it is not working i am getting a blank instead.. sed -n '/regexp/{g;1!p;};h' file1 Can anyone help? Thanks (15 Replies)
Discussion started by: usha rao
15 Replies

3. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

4. Shell Programming and Scripting

how to test input variable is a string in a select loop

Okay -- I hope I ask this correctly. I'm working on my little shell script to write vendor names and aliases to files from user input. If a user choose to add to a file, he can do that as well. I'm using a select loop for this function to list all the possible files the user can choose from.... (7 Replies)
Discussion started by: Straitsfan
7 Replies

5. Shell Programming and Scripting

Select everything between first and last occurrence of same pattern

Greetings, I am writing a script which requires as a part, selecting all the lines between the first and last occurrence of a pattern. I have an nawk alternative that is working. But thre should be a generic script that should run on all os viz, linux, sun , aix. The awk script that i... (25 Replies)
Discussion started by: usha rao
25 Replies

6. Shell Programming and Scripting

Search for a pattern,extract value(s) from next line, extract lines having those extracted value(s)

I have hundreds of files to process. In each file I need to look for a pattern then extract value(s) from next line and then search for value(s) selected from point (2) in the same file at a specific position. HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V TITLE CYTOCHROME... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies

7. Shell Programming and Scripting

PS3 select when wrong input given

Hi All I am using the below code to chose a file to view : PS3="Select file to view : " select FILE in `ls` QUIT do if ; then clear cat $FILE else break fi REPLY='' done Everything works fine as long as I am giving the correct choice . But when i give a... (4 Replies)
Discussion started by: ningy
4 Replies

8. Shell Programming and Scripting

Select command help with blank input value

I have a select menu driven script using a case statment and cannot control what happens after a user's input is just <ENTER> or the <SPACEBAR>+<ENTER>. I want it to just hit the "MAIN" function and not redraw the options. I've look everywhere for the answer and am at a loss. Here's the code:... (4 Replies)
Discussion started by: ambroze
4 Replies

9. Shell Programming and Scripting

Help with 'select' for menu input

A lot of my scripting makes use of the 'select' command to create menu driven input. A typical example of how I use it is as: somevar='' PS3='Select one: ' while ]; do select somevar in $(sqlplus -s $dbuser/$dbpw@mydb <<EOF set echo off feedback off verify off... (7 Replies)
Discussion started by: edstevens
7 Replies

10. Shell Programming and Scripting

Extract whole word preceding a specific character pattern with first occurence of the pattern

Hello. Here is a file contents : declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern =I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '=' Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
INDEXMAKER(1)							       mrtg							     INDEXMAKER(1)

NAME
indexmaker - Creates index files for mrtg web sites (mrtg-2.9.17) SYNOPSIS
indexmaker [options] regexp mrtg.cfg [other.cfg ...] OPTIONS
--output=filename set output filename (default: stdout) --filter title=~regexp select targets by matching regexp against titles --filter pagetop=~regexp select targets by matching regexp against pagetop --filter name=~regexp select targets by matchin regexp against name --title=text set title of generated index file --bodyopt=text set body tag options --pagetop=text insert this text between <BODY> and <H1>...</H1> --columns=number show graphs in a table with x columns (default: 2) --sort=title sort graphs by title --sort=name sort graphs by their name --sort=descr sort graphs by their description --sort=original leave as is (default) --enumerate add a sequence number to the title of each graph --width=number set width of graphs (default: not set) --height=number --show=day pick which graph to show in the index (default) --show=week --show=month --show=year --show=none --section=h1 h1 tag from pagetop as section heading (default) --section=title title as section headings for graphs --section=name graph name as section heading --section=descr graph description as section heading --section=portname port name entry in pagetop as section heading --rrdviewer=path path to rrdviewer (default: /cgi-bin/14all.cgi) --prefix=path path from the location of the index.html to the graphs DESCRIPTION
Indexmaker can create web pages which display the status of an array of mrtg interface status pages. --output filename set output filename (default: stdout) --filter (title|pagetop|name)(=~|!~)regexp Several filters may get set. Each filter can match agains the contents of a specific section of the mrtg config file. Name refers to the bit in square brackets (option[name]: bla). Depending on the match operator chosen (=~ or !~) the match will be positive or negative. Note that some shells consider ! a special character. It may be necessary to type !~ instead. --title text Set title of generated index file (default: regexp) --bodyopt text The value of this argument gets appended to the <BODY> tag. This allows to set document colors. By default this option is set to bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000" --columns number Display graphs in a table with number columns (default: 2) --sort title|name|descr|original Sort the graphs in the page either by title, by name, by interface description, or leave them as is. --enumerate Add a sequence number to the title of each graph --width number Set width of graphs --height number Set the height of the graphs --show day|week|month|year|none Select which graph to show in the index page. You can supress images completely with --show=none. --section h1|title|name|description|portname Select what to use as the title for each graph in the page. h1 is the H1 section from pagetop, title is the graph title, name is the bit in square brackets (option[name]: bla), and descr or description is the text from the Description field of the PageTop (the Cisco description text if it's available, otherwise just the interface description). portname is the "Port Name:" from pagetop. --rrdviewer path If you have set the LogFormat: rrdtool property in the mrtg.cfg file, the index will take this into account. The only thing you must tell it is the path to your grapher cgi. (default: /cgi-bin/14all.cgi) --prefix path By default we assume that the file generated by indexmaker is stored in WorkDir. If you want to store it somewhere else, spec- ify how to reach WorkDir from the place where the Index is stored. Note that you have to use '/' as path separator as this will be used in urls. Speaking of which, you can even enter a whole url. AUTHOR
Tobias Oetiker <tobi@oetiker.ch> LICENSE
GNU General Public License COPYRIGHT
2000-2001 Tobias Oetiker <tobi@oetiker.ch> 3rd Berkeley Distribution 2.9.17 INDEXMAKER(1)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy