Sponsored Content
Top Forums Shell Programming and Scripting match string exactly with awk/sed Post 302521745 by sidorenko on Thursday 12th of May 2011 06:24:51 AM
Old 05-12-2011
Code:
>gawk -v re="hi baby" 'match($0,re){print substr($0,RSTART,RLENGTH)}'
ahasdf
ahsshi babyshsd
hi baby

replace "hi baby" with the variable you want to pass
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed to match only exact string only in all occurences

Dear Friends, Anybody knows how to match exact lines only in multilinear. Input file: apple orange orange apple apple orange Desired output: fruit orange apple fruit i used the command (1 Reply)
Discussion started by: vasanth.vadalur
1 Replies

2. Shell Programming and Scripting

How to get part of string in awk from match

Hi, Im an awk noob and I am having trouble trying to get matches. Here is my script: #!/bin/gawk -f BEGIN {} $0 ~ /<a href=".*">.*<\/a>/{print} Ideally I want to be able to get the actual link and print it. In PHP you can do preg_replace and get the match you want by using \\1 where 1... (2 Replies)
Discussion started by: adsyuk
2 Replies

3. Shell Programming and Scripting

problem using sed to match a string

Hi There! I'm stuck with a problem trying to output some sections of a rss feed to my conky program using curl and sed. The rss feed is for tide times and I wish to output the times but not the rest to the conky desktop. To do this I need to pull out the four instances of times that are in... (4 Replies)
Discussion started by: huffpuff
4 Replies

4. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

5. 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

6. Shell Programming and Scripting

awk : match the string and string with the quotes :

Hi all, Here is the data file: - want to match only lan3 in the output . - not lan3:1 file : OPERATING_SYSTEM=HP-UX LOOPBACK_ADDRESS=127.0.0.1 INTERFACE_NAME="lan3" IP_ADDRESS="10.53.52.241" SUBNET_MASK="255.255.255.192" BROADCAST_ADDRESS="" INTERFACE_STATE=""... (2 Replies)
Discussion started by: rveri
2 Replies

7. Shell Programming and Scripting

Sed:- Supported variable replacement after string match?

Hi All, I am trying to replace the variable in the file after the particular match string. It is being replaced if i hardcode the value and with use of "&" with sed. sed -e "s/URL./& http:\\localhost:7223/g" But when am trying to pass the variable it is failing. I tried multiple... (9 Replies)
Discussion started by: sharsour
9 Replies

8. Shell Programming and Scripting

Need help with sed to match and replace a string

friends I am struck in a situation where I need to comment a line start with space as below in a file root@LOCALHOST * rw LOCALHOST* r I should comment second line only Any help please (16 Replies)
Discussion started by: mallak
16 Replies

9. Shell Programming and Scripting

Match exact String with sed command

I have a workaround to the problem i m posting, however if someone wants to look at my query and respond ... i will appreciate. This is in reference to this thread -> https://www.unix.com/shell-programming-and-scripting/267630-extract-between-two-exact-matched-strings.html I have data.txt as... (11 Replies)
Discussion started by: mohtashims
11 Replies

10. Shell Programming and Scripting

sed - print only the chars that match a given set in a string

For a given string that may contain any ASCII chars, i.e. that matches .*, find and print only the chars that are in a given subset. The string could also have numbers, uppercase, special chars such as ~!@#$%^&*(){}\", whatever a user could type in without going esoteric For simplicity take... (1 Reply)
Discussion started by: naderra
1 Replies
WOLF4SDL(6)							     Wolf4SDL							       WOLF4SDL(6)

NAME
wolf4sdl - An open-source port of id Software's classic first-person shooter SYNOPSIS
wolf4sdl [options] wolf4sdl-wl6 [options] wolf4sdl-wl6a [options] wolf4sdl-wl1 [options] wolf4sdl-sod [options] wolf4sdl-sdm [options] DESCRIPTION
Wolf4SDL is an open-source port of id Software's classic first-person shooter Wolfenstein 3D to the cross-plattform multimedia library Sim- ple DirectMedia Layer (SDL) (http://www.libsdl.org). It is meant to keep the original feel while taking advantage of some improvements. The wolf4sdl-wl6, wolf4sdl-wl6a, wolf4sdl-wl1, wolf4sdl-sod and wolf4sdl-sdm binaries start the Wolf3d Full v1.4 GT/ID/Activision, Wolf3d Full v1.4 Apogee (with ReadThis), Wolf3d Shareware v1.4, Spear of Destiny Full and Mission Disks and Spear of Destiny Demo games, respec- tively. The wolf4sdl binary is a symbolic link to one of these and is handled via Debian's update-alternatives mechanism. OPTIONS
--help This help page --tedlevel <level> Starts the game in the given level --baby Sets the difficulty to baby for tedlevel --easy Sets the difficulty to easy for tedlevel --normal Sets the difficulty to normal for tedlevel --hard Sets the difficulty to hard for tedlevel --nowait Skips intro screens --windowed Starts the game in a window --res <width> <height> Sets the screen resolution (must be multiple of 320x200 or 320x240) --resf <w> <h> Sets any screen resolution >= 320x200 (which may result in graphic errors) --bits <b> Sets the screen color depth (use this when you have palette/fading problems allowed: 8, 16, 24, 32, default: "best" depth) --joystick <index> Use the index-th joystick if available (-1 to disable joystick, default: 0) --joystickhat <index> Enables movement with the given coolie hat --samplerate <rate> Sets the sound sample rate (given in Hz, default: 44100) --audiobuffer <size> Sets the size of the audio buffer (-> sound latency) (given in bytes, default: 2048 / (44100 / samplerate)) --ignorenumchunks Ignores the number of chunks in VGAHEAD.* (may be useful for some broken mods) AUTHORS
Wolf4SDL v1.6 ($Revision: 232 $) Ported by Chaos-Software (http://www.chaos-software.de.vu) Original Wolfenstein 3D by id Software This manual page was written by Fabian Greffrath <fabian+debian@greffrath.com> for the Debian project (but may be used by others). 1.6 December 2010 WOLF4SDL(6)
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy