19.03.2024, 09:52 UhrDeutsch | English
Hallo Gast [ Registrierung | Anmelden ]

Neues Thema eröffnen   Neue Antwort erstellen
Vorheriges Thema anzeigen Druckerfreundliche Version Einloggen, um private Nachrichten zu lesen Nächstes Thema anzeigen
Autor Nachricht
bryan_e_boone
Titel: complaint about ^M on a line of shell script  BeitragVerfasst am: 07.11.2006, 21:37 Uhr



Anmeldung: 05. Jan 2006
Beiträge: 118

I installed RC4 for a buddy of mine and I'm trying to do the du-fixes.sh script from h2. as root, I keep getting complaints about the ^M at the end of a line the script. The script works fine for me (AMD64) is there a setting I missed when I installed on his box?

_________________
What is, is
 
 Benutzer-Profile anzeigen Private Nachricht senden AIM-Name MSN Messenger  
Antworten mit Zitat Nach oben
h2
Titel: RE: complaint about ^M on a line of shell script  BeitragVerfasst am: 07.11.2006, 22:46 Uhr



Anmeldung: 12. Mar 2005
Beiträge: 1005

that's not enough information to give a meaningful answer.

What is the exact nature of the error?

Line number, error, etc? However, if you run the script, and it runs without errors on one box, then you get an error with it like this, it's something else, but what I can't tell you.

_________________
Read more on dist-upgrades using du-fixes-h2.sh script.
New: rdiff-backup script
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
slh
Titel: RE: complaint about ^M on a line of shell script  BeitragVerfasst am: 07.11.2006, 23:48 Uhr



Anmeldung: 16. Aug 2004
Beiträge: 1905

Don't use windows/ DOS systems for handling text files (or scripts), those a typical DOS line endings (carriage retun + line feed, instead of \n new line) and not compatible with UN*X.
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
bryan_e_boone
Titel:   BeitragVerfasst am: 08.11.2006, 01:05 Uhr



Anmeldung: 05. Jan 2006
Beiträge: 118

It looks like it happens after the#!bash line.
h2, it doesn't have problems on my amd64 distro, that's why I think it's my problem. I mailed it as an attachment thru thunderbird to my buddy. I wonder if t-bird goofed it up (probably).
slh, I'm not using DOS/Windows to edit the file but I guess it could have gotten transposed via the Exchange email when I mail it as an attachment.
I'll download it from the site (what was the link again, h2)
I was making sure I didn't goof up an installation like some encoding option I missed.
Thanks for the info guys.
BTW I can get the exact error message if you still want it. (in the morning)
-Bryan

_________________
What is, is
 
 Benutzer-Profile anzeigen Private Nachricht senden AIM-Name MSN Messenger  
Antworten mit Zitat Nach oben
Kano
Titel:   BeitragVerfasst am: 08.11.2006, 01:22 Uhr



Anmeldung: 17. Dez 2003
Beiträge: 16783

Just use:

dos2unix script
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
h2
Titel:   BeitragVerfasst am: 08.11.2006, 01:39 Uhr



Anmeldung: 12. Mar 2005
Beiträge: 1005

bryan, if you want to get your friend the script, just go here, it's a shortcut:

cd /usr/local/bin
wget techpatterns.com/du-fixes
chmod +x du-fixes-h2.sh

or you could save it as one line:

cd /usr/local/bin;wget techpatterns.com/du-fixes;chmod +x du-fixes-h2.sh

then tell him just to paste that into console after logging in su <password> and hit enter.

that's all that is required. That avoids any potential file corruption issues altogether. I'm glad others recognized the error source, that sounds like a good guess to me as well. So just get it directly, or zip it up first, but it's really no harder typing in the above as root than saving something to /usr/local/bin as root etc.

First, of course, remember to rm / delete the old version

_________________
Read more on dist-upgrades using du-fixes-h2.sh script.
New: rdiff-backup script
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
bryan_e_boone
Titel:   BeitragVerfasst am: 08.11.2006, 17:13 Uhr



Anmeldung: 05. Jan 2006
Beiträge: 118

Works great.... The dos2unix on the h2 script then he's done is first kernel update and dist-upgrade....
BTW... I'm not sure what put the ^M on the script lines... I'll bet it was Exchange.
Thanks for the info guys.

-Bryan (askani)

_________________
What is, is
 
 Benutzer-Profile anzeigen Private Nachricht senden AIM-Name MSN Messenger  
Antworten mit Zitat Nach oben
Swynndla
Titel:   BeitragVerfasst am: 09.11.2006, 02:07 Uhr



Anmeldung: 05. Dez 2005
Beiträge: 414
Wohnort: Auckland, New Zealand
Emailing as an attachment should have been alright ... no ^M's would have been inserted. But if you friend opened the file in windows, then the windows app (depending on what he used) would have stuck in the ^M's ... and if he copy and pasted or saved, then he'd get the ^M's. Saving the attachment as is should be fine though.

_________________
Linux is evolution, not intelligent design - Linus Torvalds
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
bryan_e_boone
Titel:   BeitragVerfasst am: 09.11.2006, 02:29 Uhr



Anmeldung: 05. Jan 2006
Beiträge: 118

He may have saved the attachments in windows then used samba to snag them to linux. I have to convince him to drop the crutch and just use kanotix Winken
He's getting close.
 
 Benutzer-Profile anzeigen Private Nachricht senden AIM-Name MSN Messenger  
Antworten mit Zitat Nach oben
Beiträge vom vorherigen Thema anzeigen:     
Gehe zu:  
Alle Zeiten sind GMT + 1 Stunde
Neues Thema eröffnen   Neue Antwort erstellen
Vorheriges Thema anzeigen Druckerfreundliche Version Einloggen, um private Nachrichten zu lesen Nächstes Thema anzeigen
PNphpBB2 © 2003-2007 
 
Deutsch | English
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2004 - 2006 by Jörg Schirottke (Kano).
Consult Impressum and Legal Terms for details. Kanotix is Free Software released under the GNU/GPL license.
This CMS is powered by PostNuke, all themes used at this site are released under the GNU/GPL license. designed and hosted by w3you. Our web server is running on Kanotix64-2006.