Search Results

Search: Posts Made By: filter
1,259
Posted By RudiC
$ sed 's:\(-name FILTER\):\1 -username filter:'...
$ sed 's:\(-name FILTER\):\1 -username filter:' file
-name FILTER -username filter -node 60265 . . .
1,259
Posted By MadeInGermany
perl -pe 's/(^-name FILTER)/$1 -username filter/'...
perl -pe 's/(^-name FILTER)/$1 -username filter/' infileAdd -i option, and infile is changed directly.
1,259
Posted By Yoda
nawk ' { sub(/^-name FILTER/,"-name FILTER...
nawk ' { sub(/^-name FILTER/,"-name FILTER -username filter") } 1' filename
OR
nawk ' { sub(/^-name FILTER/,"& -username filter") } 1' file
1,975
Posted By radoulov
&transmit_files if $ENV{APPS} eq...
&transmit_files if $ENV{APPS} eq "/prod_application";
3,161
Posted By durden_tyler
Maybe something like this? $ $ cat...
Maybe something like this?


$
$ cat file_svn
https://ims-svnus.com/dev/DB/trunk/feeds/templates/shell_script.txt -r860
https://ims-svnus.com/dev/DB/trunk/db/sec_db/stored_procedures/alter.sql...
3,161
Posted By neutronscott
Do you really need a bash script and perl...
Do you really need a bash script and perl script? I could assist with completing the task in purely bash if I better understood what needs to be done.

---------- Post updated at 02:53 PM...
2,980
Posted By Scrutinizer
Try: while read url rev do ...
Try:
while read url rev
do
name=${url##*/templates/}
base=${url##*/trunk/}
dir=${base%%/templates/*}
echo "$name $dir"
done < "$file"

There's a small typo on the third line of...
2,980
Posted By Epsilon
An easy approach:
You can use the basename command for the same purpose very conveniently.Here is its syntax:

basename <absolute pathname>

It will extract the filename from the absolute path.

Example:


$$...
2,980
Posted By Scrutinizer
Try: while read url rev; do echo...
Try:
while read url rev; do
echo "${url##*/}"
done < "$file"
2,980
Posted By yazu
cat FILE ...
cat FILE
https://ims-svnus.com/dev/DB/trunk/feeds/templates/shell_script.txt -r860
https://ims-svnus.com/dev/DB/trunk/feeds/perl/templates/perl_script.txt -r867...
2,310
Posted By balajesuri
Shorter: perl -pe '$_=lc;s/_([a-z])/\u$1/g'...
Shorter:
perl -pe '$_=lc;s/_([a-z])/\u$1/g' inputfile
2,310
Posted By rangarasan
awk
Hi,

Here is the awk solution,


awk '{$0=tolower($0);while(match($0,"_")){l=substr($0,match($0,"_"),2);L=toupper(l);sub(l,L);sub(/_/,"");}}1' file



Cheers,
Ranga:)
2,310
Posted By balajesuri
perl -pe...
perl -pe '$_=lc;while(/_([a-z])/g){$x=$1;$y=uc($x);s/_$x/$y/g}' inputfile
2,310
Posted By itkamaraj
$ perl -alne '$_=~s/_/ /g;...
$ perl -alne '$_=~s/_/ /g; $_=~s/(\w+)/\u\L$1/g;$_=~s/ //g;print lcfirst $_' input.txt
filterWord
usaNewjersey
usaNewyorkNyc
10,642
Posted By birei
To add those two lines comment this instruction: ...
To add those two lines comment this instruction:

#next if $flipflop == 1 || $flipflop =~ /E0\Z/;Regards,
Birei
10,642
Posted By birei
Not sure about what are header and footer but I...
Not sure about what are header and footer but I hope you can avoid the 'out of memory' message:

$ cat script.pl
use warnings;
use strict;

die qq[Usage: perl $0 <input-file> <output-good-file>...
10,642
Posted By Corona688
while($LINE=<FILE>) { ... }
while($LINE=<FILE>)
{
...
}
1,254
Posted By michaelrozar17
With awk.. awk -F: '/command: /{print $1 FS "...
With awk..
awk -F: '/command: /{print $1 FS " echo \"" $2 " \" ";next}1' inputfile
1,254
Posted By vgersh99
sed 's#^command:\(.*\)#command: echo " \1 "#'...
sed 's#^command:\(.*\)#command: echo " \1 "#' myJILfile
9,597
Posted By rdcwayx
-i.bak will do the backup. grep -l...
-i.bak will do the backup.

grep -l "xsgd1234dap" *.sh |xargs perl -i.bak -pe 's/xsgd1234dap/xsdr3423pap/g'
9,597
Posted By roche
Make a backup first Then: find . -name...
Make a backup first

Then:
find . -name "*sh" |xargs perl -pi -e 's/find/replace/g'


it was tested on solaris


Video tutorial on how to use code tags in The UNIX and Linux Forums....
1,478
Posted By rdcwayx
sed '/^insert_job/ s/TS_QDB_/KB_OM_1876_/g'...
sed '/^insert_job/ s/TS_QDB_/KB_OM_1876_/g' yourfile
3,873
Posted By yazu
No. # is an usual char in string literals and...
No. # is an usual char in string literals and regexes :
cat >INPUTFILE
1
# comment
3
#
#
4
$ perl -lne '!/^#/ && print' INPUTFILE
1
3
4

What the error did you get?
3,873
Posted By yazu
my $n = @goodlines; $n -= grep {/^# PRODUCT/}...
my $n = @goodlines;
$n -= grep {/^# PRODUCT/} @goodlines; # or just $n -= 4 but it's not good
$footer[$datarec_line] =~ s/\d+/$n/;
3,873
Posted By yazu
Ok. Let's take a such example file: cat...
Ok. Let's take a such example file:
cat INPUTFILE
START-OF-FILE
.......
so on ....

TIMESTARTED=Thu Aug 25 01:03:50 BST 2011
START-OF-DATA
# PRODUCT=Corp/Pfd
a
b
1
c
d
3
END-OF-DATA...
Showing results 1 to 25 of 37

 
All times are GMT -4. The time now is 07:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy