Find the answer to your Linux question:
Results 1 to 2 of 2
I downloaded webmin but in all the files the path to perl is wrong, so i made a loop script that supposed to change it, but it doesnt work. Im ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Posts
    3

    Sed help


    I downloaded webmin but in all the files the path to perl is wrong, so i made a loop script that supposed to change it, but it doesnt work. Im using sed, but im not sure i have it setup properly cause i get this error:
    Code:
    sed: -e expression #1, char 11: Unknown option to 's'
    Code:
    #! /bin/sh
    for i in `ls -l *.pl
    do
    sed -e 's/!# /usr/local/bin/perl /#! /usr/bin/perl'
    echo "$i done."
    done
    Thanks.

  2. #2
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    158
    Hi,

    here is a working example...
    Code:
    #! /bin/sh
    for i in `ls -l *.pl`
    do
    cat $i |sed 's/#!\/usr\/local\/bin\/perl/#!\/usr\/bin\/perl/' > $i
    echo "$i done."
    done
    But I would use this instead...
    Code:
     perl -i -pe 's/#!\/usr\/local\/bin\/perl/#!\/usr\/bin\/perl/' *.pl
    Regards

    Jonas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •