[BusyBox] init difficulties
Brett Hunt
bhunt at myrealbox.com
Thu Oct 9 15:23:54 UTC 2003
Steve,
You may be interested in an option found an some editors that show
whitespace. For example, in vim I use the command
:set list
to show all whitespace characters. A '$' is placed at the end of lines,
dots show trailing characters, etc. You can turn it off using
:set nolist
I work in a mixed Lin/Win dev environment and this has been invaluable
for editing makefiles, python, and scripts to find errors. Another
helpful thing has been
:set ff?
to see what the file format (ff) is set to: unix, dos, mac.
Then, if it is incorrect, a real problem for scripts, I set it and save
the file again
:set ff=unix
:w
This has helped 'fix' broken scripts more times than I can count.
HTH,
Brett
Steven P Valliere wrote:
> If anyone cares, it turned out that most of my
> init script problems were due to the fact that
> the shell apparently treats some invisible/
> non-printable control characters as valid file
> (and/or directory) name characters and consequently
> was unable to find some things because some invisible
> junk was glommed onto the end of the lines.
>
> I retyped the entire scripts (using ed directly on
> my target machine) and they work fine now. Sigh.
>
> I have some comments/thoughts for developers:
>
> 1. I cannot think of any time that one SHOULDN'T
> remove trailing whitespace from input lines --
> whether from the command line itself or when
> reading a script.
>
> 2. Why would ANY character < 0x20 (space) be valid
> in a file or directory name?
>
> 3. Error messages that actually mean something
> would also be a HUGE help. For example, when
> ash tried to execute a script but there was
> invisible garbage at the end of #!/bin/sh it
> simply reported 'File not found' (or something
> to that effect) implying that the SCRIPT was
> not found. It REALLY should show the name of
> the file it was looking for. And insmod was
> reporting .o: module cannot be located (or
> again, something similar). Needless to say,
> I didn't have a single entry reading 'insmod .o'
> to the error was much less than helpful. In
> fact, the error stripped the filename itself AND
> the trailing garbage -- which would've instantly
> illustrated the problem.
>
> OK, I'll shut up now.
> Not that anyone's listening anyway.
>
More information about the busybox
mailing list