> From: [email protected] > Date: Mon, 20 Jun 2016 10:24:35 -0500 > Subject: Re: [lfs-support] #!/bin/sh: No such file or directory > > > It appears the problem was file format. I wrote some scripts in > OpenOffice and saved them as Text (.txt) but "file SomeScript_OO.sh" shows: > > POSIX shell script, UTF-8 Unicode (with BOM) text executable > > I first edited the scripts with vi looking for errors but none were > apparent. And identical files written in OO and vi appear identical > when edited.
cmp -bl cat -A diff -a od -c tr -d '[[:print:]]' . . , can help show if stray non-ascii chars are present. What do you get if you do e.g.: $ cat ORIG_FILE | tr -cd '[[:print:]]' > NEW_FILE diff -a ORIG_FILE NEW_FILE | cat -A diff -a ORIG_FILE NEW_FILE | od -c cmp -bl ORIG_FILE NEW_FILE | cat -A cmp -bl ORIG_FILE NEW_FILE | od -c $ (Other args to the commands can be useful too.) > > Again, the scripts worked, I just didn't know why I received "#!/bin/sh: > No such file or directory." I assumed I'd made an error when building > 7.9. Perhaps the file format problem is widely know but it was news to > me. I assumed Text (.txt) meant ASCII text. (Filename extensions are just basically conventions, and no guarantee/requirement that any particular program will make any use of them, whether at all or as-'expected'.) akh -- -- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style
