Sponsored Content
Full Discussion: Substitute Perl Script
Top Forums Shell Programming and Scripting Substitute Perl Script Post 302506041 by pravin27 on Friday 18th of March 2011 10:28:14 AM
Old 03-18-2011
Hi, It's working at my end. Could you please attached your foo.cfg.
Code:
# cat foo.cfg
Test
Test_Account_1
Test_Account_2
# perl -nle 's/\bTest\b/Foo/g;print $_;' foo.cfg
Foo
Test_Account_1
Test_Account_2

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Problem with cat with PERL Substitute

system("cat FILENAME | perl -e 'while(<>) { print $_;}'"); system("cat FILENAME | perl -e 'while(<>) { $_ =~ s/XXX/YYY/g; print $_;}'"); First command works fine but second command gives the following error: syntax error at -e line 1, near "{ =~" syntax error at -e line 1, near ";}"... (2 Replies)
Discussion started by: jingi1234
2 Replies

2. UNIX for Dummies Questions & Answers

how to write perl substitute command in shell scripts

How to write perl substitute command in shell script without invoking a perl script file seperately. for ex: shell script to relace IT with CSC in a file using perl substitute command. (3 Replies)
Discussion started by: param_it
3 Replies

3. AIX

pgrep substitute for porting a linux script to AIX 5.x

Hi, I'm trying to get this script to work on an AIX 5.3 box, I couldn't get pgrep for AIX, I also realize that ps works differently on the IBM boxes. Could anybody just give me the specifics of a work around for my problem, I'll adjust the whole script: #!/bin/bash # applabs.com #to do: #... (3 Replies)
Discussion started by: thebytegrill
3 Replies

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

5. Shell Programming and Scripting

How to substitute the value with in double quotes in perl?

Hi, I have string like this: $str=' DNA OR ("rna AND binding AND protein")'; I just wanted to substitute AND with a blank. How can i do that? I want the output like this: $string= DNA OR ("rna binding protein") (3 Replies)
Discussion started by: vanitham
3 Replies

6. Shell Programming and Scripting

Shell script: substitute value in text file

Hi gurus, I need help with shell script. I have various INSERT queries which inserts data into database. I want to insert 3rd column data into newline for one particular table. I have very time long txt file everytime and it have various INSERT/UPDATE queries but i have to done with it only one... (8 Replies)
Discussion started by: mirfan
8 Replies

7. Shell Programming and Scripting

Perl: substitute multiple lines

I'd like to do this using Perl command line (sorry no awk, sed, etc.) replace the 3 middle lines in a file by one line: aaa 123 bbb 234 ccc 34567 dd 4567 ee 567 to: aaa 123 AAA ee 567 I tried this but not working: perl -pi -e "s/aaa\ 123\nbbb\ 234\nccc\ 34567/AAA/" file (2 Replies)
Discussion started by: tintin78899
2 Replies

8. Shell Programming and Scripting

substitute variable for values in perl

hi all, how do i assign values passed in from command line to and sql statement in perl ?? e.g i want to assign :name1 and :Name2 to be whatever is passed into the perl script command line my $sqlStr = "select * from test_table where column1 = upper(nvl(:name1, name1 )) and column2... (1 Reply)
Discussion started by: cesarNZ
1 Replies

9. Shell Programming and Scripting

How to substitute a varible in script having value including quotes?

Hi All, We need to run a Connect direct script on Unix server to send a file to Mainframe server and at mainframe end there need to run another job through Runtask with some parameters need to be passed from C:D (unix) to mainframe. My question is I have to pass parameters like DSN and FNAME as... (2 Replies)
Discussion started by: matrix001
2 Replies

10. Programming

Substitute string using location (preferably perl).

I have a string like. ATATATATTATTATATTATATTATT I want to substitute the characters to "C" by using these locations 3 7 10 18 15 20 desired Output: ATCCCCCTTACCCCCCCCCCTTATT any clue will be great help. :wall: thanks in advance. (2 Replies)
Discussion started by: admax
2 Replies
flow-mask(1)						      General Commands Manual						      flow-mask(1)

NAME
flow-mask -- Apply tags to flow files. SYNOPSIS
flow-mask [-hk] [-b big|little] [-C comment] [-d debug_level] [-m mask_fname] [-M active_def ...] DESCRIPTION
The flow-mask utility is used to modify the source and destination mask length's in flow records. OPTIONS
-b big|little Byte order of output. -C Comment Add a comment. -d debug_level Enable debugging. -h Display help. -k Keep time from input. -m mask_fname Load masks from mask_name. Defaults to /etc/flow-tools/cfg/mask -M mask_def Use active_def as the active tag definition(s). The configuration file is a collection of definitions. A definition lists a sequence of prefixes and the mask length to replace the match- ing prefix with. Lines begining with # are treated as comments and ignored. mask-definition command Description ---------------------------------------------------------------------- mask-definition Begin mask-definition section mask-definition foo prefix List the prefix to match on and the replacement mask. prefix 128.146/16 24 EXAMPLES
# #file: masks # mask-definition foo # All networks in 128.146/16 are /24's. prefix 128.146/16 24 # except for 128.146.214/24, which are /32's. prefix 128.146.214/24 32 flow-cat flows | flow-mask -mfoo -Fmasks | flow-print -f4 FILES
Configuration files: Mask - /etc/flow-tools/cfg/mask.cfg. BUGS
None known. AUTHOR
Mark Fullmer maf@splintered.net SEE ALSO
flow-tools(1) flow-mask(1)
All times are GMT -4. The time now is 03:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy