42行のコードを持つファイルがあります。 私は27行目から40行目までの各行の先頭に '#'文字列を追加してコメントとして宣言する必要があります。sed行の先頭に文字列を追加します.20行目から30行目までだけ
これを達成する方法はsedですか?これを実現する方法を教えてください。
ありがとうございます!
#!/usr/bin/perl
use Expect;
use Switch;
use POSIX;
use XML::Simple;
use ATS::DB::connect;
use ATS::DB::build;
use ATS::Misc::helperFuncs;
use ATS::L2L3::Object;
use ATS::L2L3::Router;
use ATS::L2L3::NS;
use ATS::DB::testinstance;
use ATS::DB::L1;
use ATS::DB::resource;
use Term::ANSIColor ;
use Term::ANSIColor qw(:constants);
use Term::ExtendedColor qw(:all);
use Data::Dumper;
BEGIN{ push @INC,"//home/atsuser/Scripts/LSN/";
push @INC,"/export/home/userAutomation/LSN/Scripts/";}
use LSN;
use File::Basename;
BEGIN{ push @INC,"//home/atsuser/Scripts/Failover/";}
use FileSync;
##############
Script Flow:
1.Determine the devices which are reachable.
2.Load the build passed to script on all UP devices
3.Check Devices are UP after buildUpdate.
4.Load config on devices which are UP.
5.Exit IF any config failed Or devices are n't UP after buildUpdate.
6.Proceed to Ping test
Clt -> SNIP on R1
R1 -> SNIP on HA
Prim -> SNIP on R2
R2 -> SNIP on Server
7. EXIT IF ping test failed
8. Proceed to CURL test.
Clt -> service on Server
#START:parser inserted variables
はいあります。他の質問がある場合は[ask]を参照し、[mcve]を含めるようにしてください。 –