develooper Front page | perl.beginners | Postings from February 2002

Re: help for sed

Thread Previous | Thread Next
Bill Akins
February 6, 2002 13:29
Re: help for sed
Message ID:
I believe Perl has all of the funtionality of sed so why not use the substr() function?

I have not tested it and I'm sure others here can do this in one line, but couldn't you do something like this?

if ($string =~ / >>/i) {
$ll = (length($string) - 3);
$string = substr($string, 1, $ll);

With sed, I think it would be something along these lines:

sed 's/abc\.lnk >>/abc\.lnk/' filename

>>> r p <> 02/06/02 09:58AM >>>
hi everyone.

i am trying to use sed in order to change all my batch

the pb is:

i have the following batch:
@echo on 
TIMETHIS.exe k:\Validation\Soft\abc.exe  
k:\test_1.sct k:\Validation\PlugIn\ >>
@echo off
i want to delete all character after

how can i do with the command sed.
i have written this. but it does not work 
cd $chem

echo "Creation Of All '*.bat files ..."
find -type f -iname '*.bat' > list.txt

for i in `cat list.txt`
  echo "Processing File $i .."
  if [ -f $ ]; then rm -f $ ;fi;
  sed  -e ' s/^>>//g' $i > temp
  mv temp $i
echo "Done."

thanks for your help

Do You Yahoo!? -- Une adresse gratuite et en fran├žais !
Yahoo! Mail :

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About