Find the answer to your Linux question:
Results 1 to 2 of 2
I have a script that copyies a line from one file into another. But it changes the file format (leaves it wit Ctrl M's at EOeachL) So I have to ...
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    23

    grep converting file form to dos?

    I have a script that copyies a line from one file into another.
    But it changes the file format (leaves it wit Ctrl M's at EOeachL)
    So I have to run dos2unix on the file after!?
    Code:
    mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak
    
    cp tg/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0
    
    grep HWADDR /etc/sysconfig/network-scripts/ifcfg-eth0.bak >> /etc/sysconfig/network-scripts/ifcfg-eth0
    Why is this grep command doing this (this file is ok before the grep)

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Have you tried egrep? Also, what distribution+version of Linux are you running?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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