how to use sed command to find and replace a directory
i have a file.. which contains lot of paths ...
for eg.. file contains..
/usr/kk/rr/12345/1
/usr/kk/rr/12345/2
/usr/kk/rr/12345/3
/usr/kk/rr/12345/4
/usr/kk/rr/12345/5
/usr/kk/rr/12345/6
/usr/kk/rr/12345/7... (1 Reply)
I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows:
$count = 0;
while ( $count < $#test )
{
`sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`;
`cat 0 >... (2 Replies)
What is wrong with this line in a perl script?
$amc_data = `sed -n '/\/,/\/p' "$config_file"`
I ran the above from command line and it works fine from unix command prompt.
The code should produce output between the and tags.
The config_file is as follows:
Sun ... (2 Replies)
Experts,
We used to receive our source files with '~^' as row delimiter. This file contains 2500K records and two of the columns having value in HTML formats within the file.
While running the below commands against the file, we are encountering out of memory, could you please help to... (3 Replies)
Hi all;
I have a Perl script that uses this awk command wrapped in a "system" call; it works exactly as I want it; however I want to keep this a Perl script and have very few if any "system" command...so the question; can someone help me code this in Perl please ... i have tried an now I am... (1 Reply)
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Hi Guys
Am working on a bash script but got stuck, in this line:
32 $configValues = '';
What would be the best command to enter the password between the " Perl or sed ?
Been trying with Perl using this command:
perl -pi -e 's/''/Seattle#1669!/g'... (5 Replies)
Hi,
I have been stuck in this requirement where my file contains the below format.
20150812170500846959990854-25383-8.0.0
"ABC Report" hp96880
"4952"
20150812170501846959990854-25383-8.0.0 End of run
20150812060132846959990854-20495-8.0.0
"XYZ Report" vg76452
"1006962188"... (6 Replies)
Discussion started by: Chinmaya Kabi
6 Replies
LEARN ABOUT X11R4
perl-after-upgrade
PERL-AFTER-UPGRADE(1) User Contributed Perl Documentation PERL-AFTER-UPGRADE(1)NAME
perl-after-upgrade -- fixup FreeBSD packages that depend on perl
SYNOPSIS
perl-after-upgrade
perl-after-upgrade -f
perl-after-upgrade -v
DESCRIPTION
The standard procedure after a perl port (either lang/perl5.6 or lang/perl5.8) upgrade is to basically reinstall all other packages that
depend on perl. This is always a painful exercise. The perl-after-upgrade utility makes this process mostly unnecessary.
The tool goes through the list of installed packages, looks for those that depend on perl, moves files around, modifies shebang lines in
those scripts in which it is necessary to do so, tries its best to adjust dynamically linked binaries that link with libperl.so in the old
path, and updates the package database.
After installation of the new perl is complete, either by hand from the ports collection, or from a package, or via portupgrade, do the
following:
o go root;
o run perl-after-upgrade utility.
Do not specify any arguments at first, so it does nothing destructive. Pay attention to the produced output and especially to
errorlist at the end, if any;
o run the utility again, with -f command line option.
This will actually do the work. Again, pay attention to the output produced;
o fix any reported errors;
o reinstall required packages:
The utility will tell you what packages that depend on perl it could not handle. It will also tell you why it happened (for example,
they were compiled against a binary incompatible perl). If you want such packages to remain operational, you will have to reinstall
then by hand or via portupgrade.
o review the files left in the older perl installation.
This is typically /usr/local/lib/perl5/site_perl/5.X.Y/. There should be very little, if any, files in that directory and its subdi-
rectories, excepting a number of .ph files;
o check that things work as they should;
o remove backup files from the package database.
Those will be /var/db/pkg/*/+CONTENTS.bak;
o that's all.
COPYRIGHT AND LICENSE
Copyright 2005 by Anton Berezin
"THE BEER-WARE LICENSE" (Revision 42)
<tobez@FreeBSD.org> wrote this module. As long as you retain this
notice you can do whatever you want with this stuff. If we meet some
day, and you think this stuff is worth it, you can buy me a beer in
return.
Anton Berezin
NO WARRANTY OF ANY KIND, USE AT YOUR OWN RISK.
HISTORY
The first version of this utility was not bundled with perl package on FreeBSD. It was dumber than the current version in several impor-
tant areas. It was faster.
CREDITS
Thanks to Mathieu Arnold for discussion.
SEE ALSO perl(1).
perl v5.8.9 2009-04-13 PERL-AFTER-UPGRADE(1)