Sponsored Content
Top Forums Shell Programming and Scripting sed to awk (regex pattern) how? Post 302369020 by TehOne on Friday 6th of November 2009 08:56:47 AM
Old 11-06-2009
Thanks alot buddy, now I'm having another problem...

Basically befor the awk code there are some other variables in my shell script...

Example:

TEST="TESTING"

find debugme -name "*.txt" | awk 'BEGIN{.................
.........

system("echo $TEST") doesn't work...

How can I get the variables to work within the awk script? I need those informations to execute another script.. like system("exscript $TEST t[1]"....)
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

blank space in regex pattern using sed

why does sed 's/.* //' show the last word in a line and sed 's/ .*//' show the first word in a line? How is that blank space before or after the ".*" being interpreted in the regex? i would think the first example would delete the first word and the next example would delete the second... (1 Reply)
Discussion started by: glev2005
1 Replies

2. Shell Programming and Scripting

Selecting a part of the text (regex pattern, awk, sed)

Hello, let's start by giving you guys a few examples of the text: "READ /TEXT123/ABC123" "READ /TEXT123/ABC123/" "READ TEXT123/ABC123" "READ TEXT123/ABC123/" "READ TEXT123/TEXT456/ABC123" "READ /TEXT123/TEXT456/ABC123" "READ /TEXT123/TEXT456/ABC123/" TEXT and ABC can be and I... (5 Replies)
Discussion started by: TehOne
5 Replies

3. Shell Programming and Scripting

SED: Pattern repitition regex matching

Fairly straightforward, but I'm having an awful time getting what I thought was a simple regex to work. I'll give the command I was playing with, and I'm aware why this one doesn't work (the 1,3 is off the A-Z, not the whole expression), I just don't know what the fix is: Actual Output(s): $... (5 Replies)
Discussion started by: Vryali
5 Replies

4. Shell Programming and Scripting

Question on awk/sed/regex

I plan to do something like this in awk that's embedded in a shell script. I have extracted a text file using awk and the output is before example: <USDOLLARS|xxx> I want to use get rid of the starting "<" and anything after the pipe "|" after example: USDOLLARS How do I do that?? I... (8 Replies)
Discussion started by: deadyetagain
8 Replies

5. Shell Programming and Scripting

To print lines between 2 timestamps using awk|sed and regex

Hi, I am using the following code to fetch lines that are generated in last 1 hr . Hence, I am using date function to calculate -last 1 hr & the current hr and then somehow use awk (or sed-if someone could guide me better) with some regex pattern. dt_1=`date +%h" "%d", "%Y\ %l -d "1 hour... (10 Replies)
Discussion started by: sarah-alikhan31
10 Replies

6. Shell Programming and Scripting

Regex in sed to find specific pattern and assign to variable

(5 Replies)
Discussion started by: radioactive9
5 Replies

7. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

8. UNIX for Advanced & Expert Users

sed REGEX to print multiple occurrences of a pattern from a line

I have a line that I need to parse through and extract a pattern that occurs multiple times in it. Example line: getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed,... (4 Replies)
Discussion started by: Vidhyaprakash
4 Replies

9. Shell Programming and Scripting

REGEX help required and some sed/awk help as well

Hi guys, I am coding a bash script that makes use of php scripts to pull URL's from a website. These url links will have numbers in them like 0.2.3 I want to make a regex that will yield me such numbers if I use a command like preg_grep. Question1: I need a regex that will tell my preg_grep... (2 Replies)
Discussion started by: mojoman
2 Replies

10. UNIX for Beginners Questions & Answers

Sed/awk to delete a regex between range of lines

Hi Guys I am looking for a solution to one problem to remove parentheses in a range of lines. Input file module bist_logic_inst(a, ab , dhd, dhdh , djdj, hdh, djjd, jdj, dhd, dhp, dk ); input a; input ab; input dhd; input djdj; input dhd; output hdh; output djjd; output jdj;... (5 Replies)
Discussion started by: kshitij
5 Replies
DEFINED(3)								 1								DEFINED(3)

defined - Checks whether a given named constant exists

SYNOPSIS
bool defined (string $name) DESCRIPTION
Checks whether the given constant exists and is defined. Note If you want to see if a variable exists, use isset(3) as defined(3) only applies to constants. If you want to see if a function exists, use function_exists(3). PARAMETERS
o $name - The constant name. RETURN VALUES
Returns TRUE if the named constant given by $name has been defined, FALSE otherwise. EXAMPLES
Example #1 Checking Constants <?php /* Note the use of quotes, this is important. This example is checking * if the string 'TEST' is the name of a constant named TEST */ if (defined('TEST')) { echo TEST; } ?> SEE ALSO
define(3), constant(3), get_defined_constants(3), function_exists(3), The section on Constants. PHP Documentation Group DEFINED(3)
All times are GMT -4. The time now is 02:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy