Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: jayjwa Newsgroups: comp.os.linux.misc Subject: Re: CUPS print to FAX for Brother MFC printers Date: Sat, 25 Apr 2026 12:01:22 -0400 Organization: atr2net 2026 Message-ID: <87ldeb58rx.fsf@atr2.ath.cx> References: <10s453n$5uph$1@dont-email.me> <8tjnbmxas1.ln2@Telcontar.valinor> <10sb89u$29ko5$4@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: solani.org; logging-data="1004372"; mail-complaints-to="abuse@news.solani.org" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:vGJjcNmKtDEALCxx2kLOWiiSmy0= sha1:CuRu7Wx/ss2IdizK/uhszpm8S8M= X-User-ID: eJwNw4ENACEIA8CVrECRcRCe/UfwLzkTguVKo9rY3C3Zc1cSiP/0QXR/ekoKw+USlumJ2rWbDyQkEU8= Xref: csiph.com comp.os.linux.misc:85924 Allodoxaphobia writes: >> A script that starts with #!/bin/bash will just work anywhere. > > Well, not in any *BSD > > The 'universal', 'smart' way is: #!/usr/bin/env bash The assumption is that "env" will always always always live in /usr/bin on any *nix system, while bash and friends might live in /bin or /usr/bin or even some other place if bash is not the default shell (such as on older versions of Solaris). Calling env in a shebang with no other arguments just seeks out the executable you give it, providing it is in the user's PATH. uname Linux ls -l /usr/bin/env /usr/bin/bash /bin/bash /bin/env -rwxr-xr-x 1 root root 1362000 Dec 12 16:50 /bin/bash* -rwxr-xr-x 1 root root 56496 Apr 20 16:48 /bin/env* lrwxrwxrwx 1 root root 9 Dec 15 09:28 /usr/bin/bash -> /bin/bash* lrwxrwxrwx 1 root root 13 Apr 23 12:01 /usr/bin/env -> ../../bin/env* uname SunOS which bash env /usr/bin/bash /usr/bin/env ls -l /usr/bin/bash /usr/bin/env -r-xr-xr-x 1 root bin 1.5M Jan 28 11:38 /usr/bin/bash* -r-xr-xr-x 1 root bin 13K Apr 12 19:11 /usr/bin/env* On some systems, /bin is now a symlink to /usr/bin. file -h /bin /bin: symbolic link to ./usr/bin That means /bin/bash would still work there even without env. I've never seen a system where /usr was a mount point. Maybe that was a thing in the 80s or 90s. Early on, Slackware was set up so that /usr could be, for example, remote mounted via NFS but that's not been the case in a very long time. Some people remote mount their ~/ but that's a different issue entirely. In actual practice, the difference between systems is great enough that using /usr/bin/env bash doesn't give you much in return anyway and you still have to write specifically for the system you're on. ls, grep, make, and some others are not the GNU versions by default on Sun, and even tar will cry if you ask it "tar --version". tar --version tar: s: unknown function modifier Usage: tar {c|r|t|u|x}[BDeEFhilmnopPTvw@/[0-7]][bf][X...] [j|J|z|Z] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}... I'd assume this is the situation on HP-UX, AIX, Ultrix, BSD family, etc. If you're only writing for Linux, /bin/bash is very safe. Lastly, you can env shebang python. This works on Linux, Sun, and likely *BSD. nano demoenv.py chmod 755 demoenv.py ./demoenv.py This is from Python cat demoenv.py #!/usr/bin/env python3 print( "This is from Python" ) Oh, we were talking about printers? I hate them and gave up on them decades ago because they almost never work correctly outside of Windows or Mac and getting CUPS to dance is a nightmare. Just use a kiosk at some office store. -- PGP Key ID: 781C A3E2 C6ED 70A6 B356 7AF5 B510 542E D460 5CAE "The Internet should always be the Wild West!"