|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I have a script which seeks for ^M in files. e.g. it include a line say - find $(pwd) -type f -exec grep -l '^M' {} \; Sometime while editing this script in Windows I mess with ^M & the only way to restore is to go in Unix & edit the file in vi & come back. So as a remedy (what I could think of) is there some HEX alternative I could use for ^M ? Or anything else which represents ^M. 10x NeO |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Apr 30, 3:43 pm, NeOnD <vikas...@gmail.com> wrote:
> Hi, > > I have a script which seeks for ^M in files. e.g. it include a line > say - > find $(pwd) -type f -exec grep -l '^M' {} \; > > Sometime while editing this script in Windows I mess with ^M & the > only way to restore is to go in Unix & edit the file in vi & come > back. > So as a remedy (what I could think of) is there some HEX alternative I > could use for ^M ? Or anything else which represents ^M. > > 10x > NeO This should work: find $(pwd) -type f -exec grep -l "$(echo "\r")" {} \; |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
That works buddy. Thanks
![]() |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On May 1, 12:43 am, NeOnD <vikas...@gmail.com> wrote:
> Hi, > > I have a script which seeks for ^M in files. e.g. it include a line > say - > find $(pwd) -type f -exec grep -l '^M' {} \; > > Sometime while editing this script in Windows I mess with ^M & the > only way to restore is to go in Unix & edit the file in vi & come > back. > So as a remedy (what I could think of) is there some HEX alternative I > could use for ^M ? Or anything else which represents ^M. > > 10x > NeO If you are using bash, you can enter character verbatim by pressing Control-V followed by that character. In your case: .... -exec grep -l '^M' {} \; where, the '^M' above is not '^' and 'M', rather it's a control-v control-m |
|
![]() |
| Outils de la discussion | |
|
|