• CUPS print to FAX for Brother MFC printers

    From Lew Pitcher@[email protected] to alt.os.linux, comp.os.linux.misc on Mon Apr 20 03:04:23 2026
    From Newsgroup: comp.os.linux.misc

    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have installed the appropriate Brother "driver" packages to use it under CUPS.

    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes
    a commandline user script ("brpcfax")to "print to fax", that seems to have
    been written by someone with only a rudimentary concept of what users would
    use it for. Written not in POSIX shell, but in bash, it queues documents to
    a fixed-name print queue ("BRFAX") to be faxed by the printer attached to
    this queue.

    The script, while serviceable, seemed to me to be only just barely adequate
    to it's task, and I have endeavoured to rewrite it so as to provide a few
    more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However, I'm not so vain as to think that what I've coded is universal. So, I'd like
    to ask if anyone is interested in testing this script for me.

    It replaces /only/ the /usr/bin/brpcfax script (symlinked to /opt/brother/fax/brmfcfax/command/brpcfax), and, in addition to being a
    drop in replacement for brpcfax, is
    a) written entirely as a POSIX shell script
    b) written to allow user selection of the fax printer queue
    (where the sysadmin has configured CUPS or LPR(NG) to use a different
    queue name for the Brother FAX driver),
    c) handles multiple documents (recognizing restrictions of the Brother
    Fax driver),
    d) properly handles commandline arguments (including file paths) that
    include embedded spaces, and
    e) returns the exit code of the underlying lpr command, rather than
    a fixed 0 returncode

    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.


    Thanks in advance
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From jmj@[email protected] to comp.os.linux.misc on Mon Apr 20 13:09:06 2026
    From Newsgroup: comp.os.linux.misc

    W dniu 20.04.2026 o 05:04, Lew Pitcher pisze:
    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have installed the appropriate Brother "driver" packages to use it under CUPS.

    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes
    a commandline user script ("brpcfax")to "print to fax", that seems to have been written by someone with only a rudimentary concept of what users would use it for. Written not in POSIX shell, but in bash, it queues documents to
    a fixed-name print queue ("BRFAX") to be faxed by the printer attached to this queue.

    The script, while serviceable, seemed to me to be only just barely adequate to it's task, and I have endeavoured to rewrite it so as to provide a few more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like to ask if anyone is interested in testing this script for me.
    [...]
    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.

    I think it will be good idea drop a line in to Brother company if they
    are interested with such "upgrade".
    Personally I have only Brother MFC-L2752DW, not business machine like
    yours. I think few person can afford Brother MFC-L8610CDW and use it effectively in home.
    --
    Jacek Marcin Jaworski, Pruszcz Gd., woj. Pomorskie, Polska 🇵🇱, EU 🇪🇺;
    tel.: +48-609-170-742, najlepiej w godz.: 5:00-5:55 lub 16:00-17:25; <[email protected]>, gpg: 4A541AA7A6E872318B85D7F6A651CC39244B0BFA;
    Domowa s. WWW: <https://energokod.gda.pl>;
    Mini Netykieta: <https://energokod.gda.pl/MiniNetykieta.html>;
    Mailowa Samoobrona: <https://emailselfdefense.fsf.org/pl>.
    UWAGA:
    NIE ZACIĄGAJ "UKRYTEGO DŁUGU"! PŁAĆ ZA PROG. FOSS I INFO. INTERNETOWE! CZYTAJ DARMOWY: "17. Raport Totaliztyczny - Patroni Kontra Bankierzy": <https://energokod.gda.pl/raporty-totaliztyczne/17.%20Patroni%20Kontra%20Bankierzy.pdf>

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Mon Apr 20 13:07:22 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 20 Apr 2026 13:09:06 +0200, 🇵🇱Jacek Marcin Jaworski🇵🇱 wrote:

    W dniu 20.04.2026 o 05:04, Lew Pitcher pisze:
    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have >> installed the appropriate Brother "driver" packages to use it under CUPS.

    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes
    a commandline user script ("brpcfax")to "print to fax", that seems to have >> been written by someone with only a rudimentary concept of what users would >> use it for. Written not in POSIX shell, but in bash, it queues documents to >> a fixed-name print queue ("BRFAX") to be faxed by the printer attached to
    this queue.

    The script, while serviceable, seemed to me to be only just barely adequate >> to it's task, and I have endeavoured to rewrite it so as to provide a few
    more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like >> to ask if anyone is interested in testing this script for me.
    [...]
    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.

    I think it will be good idea drop a line in to Brother company if they
    are interested with such "upgrade".
    Personally I have only Brother MFC-L2752DW, not business machine like
    yours. I think few person can afford Brother MFC-L8610CDW and use it effectively in home.

    A good suggestion, Jacek, and one that I will follow up on shortly.

    Seeing the code quality from Brother, however, I want to make sure
    that my script exceeds their standards, and shows them a standard
    that they can aspire to. (No, not vain at all, am I? ;-) )

    And, this means, besides my alpha test, I need some beta testers.
    A quick look at the Brother website tells me that your MFC-L2752DW
    can send faxes, and the "print to fax" package is the same as for
    my MFC-L8610CDW. Do you use this function, and would you be willing
    to try my script (even a simple test fax to the HP or Canon "fax-back" service)?

    Note that all the files I'd supply will be text files; you can inspect
    them to see exactly what they do, and how they do it.


    Thanks for your consideration. I appreciate the advice and help.
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Mon Apr 20 15:07:17 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 20 Apr 2026 13:07:22 +0000, Lew Pitcher wrote:

    On Mon, 20 Apr 2026 13:09:06 +0200, 🇵🇱Jacek Marcin Jaworski🇵🇱 wrote:

    W dniu 20.04.2026 o 05:04, Lew Pitcher pisze:
    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have >>> installed the appropriate Brother "driver" packages to use it under CUPS. >>>
    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes >>> a commandline user script ("brpcfax")to "print to fax", that seems to have >>> been written by someone with only a rudimentary concept of what users would >>> use it for. Written not in POSIX shell, but in bash, it queues documents to >>> a fixed-name print queue ("BRFAX") to be faxed by the printer attached to >>> this queue.

    The script, while serviceable, seemed to me to be only just barely adequate >>> to it's task, and I have endeavoured to rewrite it so as to provide a few >>> more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like >>> to ask if anyone is interested in testing this script for me.
    [...]
    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.

    I think it will be good idea drop a line in to Brother company if they
    are interested with such "upgrade".
    [snip]

    A good suggestion, Jacek, and one that I will follow up on shortly.


    For what it's worth, I've both published the code on my website (http://justlinux.ca/node/98) and contacted Brother to see if
    they are interested in it.

    [snip]
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc, alt.os.linux on Wed Apr 22 14:25:26 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 20 Apr 2026 03:04:23 +0000, Lew Pitcher wrote:

    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have installed the appropriate Brother "driver" packages to use it under CUPS.
    [snip]
    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like to ask if anyone is interested in testing this script for me.
    [snip]

    In recognition of the niche (and declining) status of FAX, and the especially niche status of "print to fax" through a Brother MFC printer, I have licenced my script under the GNU GPL v2, and the associated manpage under the GPL FDL v1.3, and will publish them (the script, and the manpage) here and on my website.

    If anyone is interested, they can download the entire source package from
    http://justlinux.ca/node/98

    And, here is the manpage, so that you can evaluate if you want to try the utility:

    ----------------------------------- 8< -------------------------------------- .TH "BRPCFAX" "1" "2026\-04\-09" "LEW PITCHER" "UTILITIES"
    .SH "NAME"
    brpcfax \- commandline print-to-fax for Brother MFC/FAX devices

    .SH SYNOPSIS
    .SY brpcfax
    .OP \-p <PRINTER>
    .B \-o
    .I fax-broadcast=<PATH>|fax-number=<PHONE_NUMBER>
    .OP \-o --brpcfax-debug=<LEVEL>
    .OP \-o .\|.\|.
    .RI [ FILE
    .IR .\|.\|. ]
    .YS

    .SH DESCRIPTION
    .PP
    .B brpcfax
    provides a commandline facility to send faxes via a Brother MFC/FAX device.
    It fronts the
    .I lpr(1)
    command, collecting requisite fax-related information and print files
    for submission (via lpr(1)) to the fax machine.

    .SH OPTIONS
    .PP
    .BI \-P " <PRINTER>"
    .RS 4
    If specified, this parameter causes brpcfax(1) to spool output to the specified .I <PRINTER>
    as the Brother MFC/FAX device. Left unspecified, the printer defaults to
    the value of the FAXPRINTER variable set in the
    .B brmfcfax.config
    file, or "BRFAX" if the FAXPRINTER setting is absent from the config file.
    .RE

    .PP
    .BI \-o " fax-broadcast=<FILENAME>"
    .RS 4
    If specified, this parameter causes brpcfax(1) to send the fax to all the telephone
    numbers specified in the associated file named by FILENAME. If not specified, then
    brpcfax(1) will expect the
    .I \-o fax-number=<PHONE_NUMBER>
    flag.
    .RE

    .PP
    .BI \-o " fax-number=<PHONE_NUMBER>"
    .RS 4
    If specified, this parameter causes brpcfax(1) to send the fax to the specfied telephone number. If not specified, then brpcfax(1) will expect the
    .I \-o fax-broadcast=<FILENAME>
    flag.
    .RE

    .PP
    .BI \-o " --brpcfax-debug=<LEVEL>"
    .RS 4
    If specified, this parameter causes brpcfax(1) to provide debugging information.
    Valid levels are
    .IP 0 4
    live execution without debugging,
    .IP 1 4
    live execution with debugging,
    .IP 2 4
    no execution, debugging only
    .P
    Any other value will invoke live execution without debugging.
    .RE

    .PP
    .BI \-o " ..."
    .RS 4
    Optionally, the commandline may include other lpr(1) -o options as necessary. See the
    results of lpoptions(1) for a list of options recognized by the Brother MFC/FAX device,
    .RE

    .PP
    .B FILE ...
    .RS 4
    Specifies the path to the file (or files) to send to the FAX printer. If the commandline
    does not specify any files, the utility will use the stdin stream as it's data source.
    .RE

    .SH FILES
    .PP
    .B /opt/brother/fax/brmfcfax/config/brmfcfax.config
    .RS 4
    This contains the brpcfax(1) configuration values, in SHELL script form.
    .RE

    .PP
    .B /opt/brother/fax/brmfcfax/lpd/i686/brps2brfax
    .PP
    .B /opt/brother/fax/brmfcfax/lpd/x86_64/brps2brfax
    .PP
    .B /opt/brother/fax/brmfcfax/lpd/armv71/brps2brfax
    .RS 4
    This binary (supplied in three different machine architectures) provides
    the raw interface between the print system and the Brother MFC/FAX device.
    In the case of brpcfax(1), this program provides fax number validation.
    .RE

    .SH NOTES
    .PP
    This version of brpcfax(1) is a functional replacement (with enhancements)
    of the
    .B brpcfax
    script supplied by Brother in the
    .B brmfcfaxdrv-2.0.2
    package. This version, written as a POSIX shell compatible script, will
    .IP \(bu 4
    allow
    .B brmfcfax.config
    to assign a default FAX printer through a shell assignment to the
    .B FAXPRINTER
    variable. If not set by brmfcfax.config, this script defaults the FAX
    printer assignment to "BRFAX".
    .IP \(bu 4
    provide a commandline option to override the default FAX printer assignment
    .IP \(bu 4
    use the POSIX shell
    .B getopts
    built-in command to iterate through commandline options
    .IP \(bu 4
    accept multiple print files for faxing
    .RS 4
    .BI NB: " Each file will constitute it's own FAX, and dial-out separately. To send"
    .I multiple files in one FAX dialout, use a utility program to combine the files,
    .I and pipe the results into brpcfax. For example:
    .EX
    qpdf --pages "fax cover.pdf" "My Document.pdf" -- --empty - |
    brpcfax -P myFax -o fax-number=15551234567
    .EE
    .RE
    .IP \(bu 4
    properly handle print file names with embedded spaces
    .IP \(bu 4
    correct some error exit codes
    .IP \(bu 4
    return lpr exit code as our own status

    .SH SEE ALSO
    .PP
    .B lpr(1), lpoptions(1)

    .SH AUTHOR
    .PP
    .MT lew.pitcher\:@digitalfreehold.ca
    Lew Pitcher
    .ME

    .SH COPYRIGHT
    This document is copyrighted by Lew Pitcher (2026) and licensed
    under the GNU Free Documentation License version 1.3. See
    .UR https://\:www.gnu.org/\:licenses/\:fdl-1.3.html#license-text
    The GNU Free Documentation Licence v1.3
    .UE ,
    for details.

    ----------------------------------- >8 -------------------------------------- --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Wed Apr 22 14:27:57 2026
    From Newsgroup: comp.os.linux.misc

    On Wed, 22 Apr 2026 14:25:26 +0000, Lew Pitcher wrote:

    On Mon, 20 Apr 2026 03:04:23 +0000, Lew Pitcher wrote:

    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have >> installed the appropriate Brother "driver" packages to use it under CUPS.
    [snip]
    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like >> to ask if anyone is interested in testing this script for me.
    [snip]

    In recognition of the niche (and declining) status of FAX, and the especially niche status of "print to fax" through a Brother MFC printer, I have licenced my script under the GNU GPL v2, and the associated manpage under the GPL FDL v1.3, and will publish them (the script, and the manpage) here and on my website.

    If anyone is interested, they can download the entire source package from
    http://justlinux.ca/node/98


    And, here is my brpfax script itself

    ----------------------------------- 8< -------------------------------------- #!/bin/sh

    ## Commandline print-to-fax for Brother MFC/FAX devices
    # Copyright (C) 2026 - Lew Pitcher <[email protected]>

    # This program is free software; you can redistribute it and/or modify it
    # under the terms of the GNU General Public License as published by the Free
    # Software Foundation; either version 2 of the License, or (at your option)
    # any later version.
    #
    # This program is distributed in the hope that it will be useful, but WITHOUT
    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
    # more details.
    #
    # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA
    #

    # NOTES:
    # 1) This script written, in POSIX shell script, as functional replacement
    # (with enhancements) of "brpcfax" script supplied by Brother with the
    # brmfcfaxdrv-2.0.2 package. This version will
    # a) allow brmfcfax.config to override default printer assignment ("BRFAX")
    # b) allow commandline option to override printer assignment
    # c) use POSIX shell getopts to iterate through commandline options
    # d) accept multiple print files for faxing
    # NB: each file will constitute it's own FAX and dial-out separately
    # To send multiple files in one FAX dialout, combine the files
    # using qpdf or pdfunite, and pipe the results into brpcfax
    # e) properly handle print file names with embedded spaces
    # f) correct some error exit codes
    # g) return lpr exit code as our own status
    # 2) This script written to use POSIX shell and utilities,
    # to be invoked with /bin/sh. Besides the Brother fax specific tools,
    # it depends on uname(1), test(1), tr(1), and lpr(1), and the getopts
    # and eval shell built-in commands

    #====================================== SETUP ==================================
    # can override default FAXPRINTER in brmfcfax.config
    # NB: this default value selected to match the fixed, hardcoded printer value from
    # the Brother implementation of this script.
    FAXPRINTER=BRFAX

    # Locate and load default configuration
    BROTHER_BASE=/opt/brother/fax/brmfcfax
    . "$BROTHER_BASE/config/brmfcfax.config"

    # Locate executable version of Brother brps2brfax utility program
    # NB: Brother supplies three versions of brps2brfax:
    # an intel 32bit version, an intel 64bit version, and an ARM version
    # This assignment uses our system's "machine hardware name" to select
    # the proper supplied version
    BRPS2BRFAX="${BROTHER_BASE}/lpd/$(uname -m)/brps2brfax"

    # ensure that fax number validator program present and executable
    [ -e "${BRPS2BRFAX}" ] || BRPS2BRFAX="./brps2brfax" # if default isnt executable, use local validator
    [ -e "${BRPS2BRFAX}" ] || exit 0 # if validator isnt executable, exit early
    # NB: above exit is broken by design. IMHO, this exit should have returned an error status value, not 0

    # Establish some variables, and set defaults
    LPR_ARGS="" # list of args to pass to lpr(1)
    FAX_DOC="" # path(s) to document(s) to print to fax DEBUG=0 # default debug level for absent "-o --brpcfax-debug"
    BROADCAST_FILE="" # path to file of fax numbers for fax-broadcast FAX_NUMBER="" # phone number for fax-number

    #=========== PROCESS COMMANDLINE ARGUMENTS ==========
    # NB: The original Brother brpcfax did not properly handle the specification of # multiple print files, which would be necessary for the inclusion of "Fax Cover"
    # pages, or the faxing of multiple documents.
    #
    # This version attempts to fix this by using the getopts buitin to parse the
    # command-line arguments, so as to aggregate all the documents (assumed to
    # follow the last flagged option) into one single list. The later invocation
    # of lpr(1) will pass this document list onwards to be faxed as a whole.
    #
    # Additionally, the original implementation did not handle the accumulation of # arguments and filenames in a "space safe" manner, meaning that the original # script would not preserve those original values that included spaces (such
    # as "some file.pdf") and would express them as multiple values (as in "some"
    # "file.pdf"). This code attempts to remedy this failing by substituting variables
    # and logic that will preserve the spaces in individual values.

    while getopts 'o:P:' opcode
    do
    case $opcode in
    'o') # -o <something>
    case "${OPTARG%%=*}" in
    fax-broadcast) # -o fax-broadcast=<filename>
    # intercept -o fax-broadcast= argument, extract and localize the broadcast file
    # step 1: remove the leading "fax-broadcast="
    # step 2: expand ~/something, leave others alone
    # step 3: change relative path into absolute path
    BROADCAST_FILE="${OPTARG#*=}"
    [ "${BROADCAST_FILE}" != "${BROADCAST_FILE#~*}" ] && BROADCAST_FILE="${HOME}${BROADCAST_FILE#~*}"
    [ "${BROADCAST_FILE}" = "${BROADCAST_FILE#/*}" ] && BROADCAST_FILE="${PWD}/${BROADCAST_FILE}"
    ;;

    fax-number) # -o fax-number=<phone-number>
    # intercept -o fax-number argument, and extract the target telephone number
    FAX_NUMBER="${OPTARG#*=}"
    ;;

    --brpcfax-debug) # -o --brpcfax-debug=<debug_level>
    # intercept -o --brpcfax-debug argument, and set the debug level
    DEBUG="${OPTARG#*=}"
    ;;

    *) # -o <something else>
    # group all other -o <something> arguments together
    LPR_ARGS="$LPR_ARGS -o '$OPTARG'"
    ;;
    esac
    ;;

    'P') # -P <fax_printer>
    FAXPRINTER="$OPTARG"
    ;;

    *) # some unexpected flag
    echo 'Internal error' >&2
    exit 1
    ;;
    esac
    done

    # discard all processed arguments.
    # populate the remainder as a list of files to fax
    shift $(($OPTIND-1))
    for ARG in "$@"
    do
    FAX_DOC="$FAX_DOC '$ARG'"
    done

    # =======================================================================
    # validate and extract the fax number(s)
    # NB: $TXLOG, $TXLOGDIR and $TXLOGFILE set by brmfcfax.config file
    if ! FAXTARGET=$(${BRPS2BRFAX} --number-check --fax_num="${FAX_NUMBER}" --fax_list="${BROADCAST_FILE}")
    then
    ERRMSG="INVALID FAX NUMBER [ ${FAXTARGET} ]"
    echo ${ERRMSG}
    [ "$(echo "$TXLOG" | tr 'a-z' 'A-Z' )" = "YES" ] && echo "ERROR: ${ERRMSG}" >>"${TXLOGDIR}/${TXLOGFILE}"
    # NB: Original Brother brpcfax code used exit code -1, which isn't a valid exit code
    exit 255
    fi

    # execute the print-to-fax request
    case "${DEBUG}" in
    0)
    eval lpr -P "${FAXPRINTER}" -o fax-number="${FAXTARGET}" $LPR_ARGS $FAX_DOC
    ;;
    1)
    echo lpr -P "${FAXPRINTER}" -o fax-number="${FAXTARGET}" $LPR_ARGS $FAX_DOC
    eval lpr -P "${FAXPRINTER}" -o fax-number="${FAXTARGET}" $LPR_ARGS $FAX_DOC
    ;;
    2)
    echo lpr -P "${FAXPRINTER}" -o fax-number="${FAXTARGET}" $LPR_ARGS $FAX_DOC
    ;;
    *)
    eval lpr -P "${FAXPRINTER}" -o fax-number="${FAXTARGET}" $LPR_ARGS $FAX_DOC
    ;;
    esac


    # Exit using status from last executed command
    # for DEBUG == 2, that is the status of the echo cmd
    # for all others, that is the status of the lpr cmd

    ----------------------------------- >8 -------------------------------------- --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Wed Apr 22 21:24:56 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-20 05:04, Lew Pitcher wrote:
    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have installed the appropriate Brother "driver" packages to use it under CUPS.

    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes
    a commandline user script ("brpcfax")to "print to fax", that seems to have been written by someone with only a rudimentary concept of what users would use it for. Written not in POSIX shell, but in bash, it queues documents to
    a fixed-name print queue ("BRFAX") to be faxed by the printer attached to this queue.

    The script, while serviceable, seemed to me to be only just barely adequate to it's task, and I have endeavoured to rewrite it so as to provide a few more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like to ask if anyone is interested in testing this script for me.

    I don't have a brother printer, sorry.

    But I wonder what is the issue if the script is written for bash. So
    what? I assume that the SHEBANG specifies bash, not posix. I have
    scripts in my system that specify a different shell. That's not a
    problem, each script uses the shell it was designed for, and I have all
    of them installed, space is not a problem anymore.





    It replaces /only/ the /usr/bin/brpcfax script (symlinked to /opt/brother/fax/brmfcfax/command/brpcfax), and, in addition to being a
    drop in replacement for brpcfax, is
    a) written entirely as a POSIX shell script
    b) written to allow user selection of the fax printer queue
    (where the sysadmin has configured CUPS or LPR(NG) to use a different
    queue name for the Brother FAX driver),
    c) handles multiple documents (recognizing restrictions of the Brother
    Fax driver),
    d) properly handles commandline arguments (including file paths) that
    include embedded spaces, and
    e) returns the exit code of the underlying lpr command, rather than
    a fixed 0 returncode

    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.

    I hope they answer and accept your contribution :-)



    Thanks in advance
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Wed Apr 22 19:41:50 2026
    From Newsgroup: comp.os.linux.misc

    On Wed, 22 Apr 2026 21:24:56 +0200, Carlos E.R. wrote:

    On 2026-04-20 05:04, Lew Pitcher wrote:
    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have >> installed the appropriate Brother "driver" packages to use it under CUPS.

    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes
    a commandline user script ("brpcfax")to "print to fax", that seems to have >> been written by someone with only a rudimentary concept of what users would >> use it for. Written not in POSIX shell, but in bash, it queues documents to >> a fixed-name print queue ("BRFAX") to be faxed by the printer attached to
    this queue.

    The script, while serviceable, seemed to me to be only just barely adequate >> to it's task, and I have endeavoured to rewrite it so as to provide a few
    more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like >> to ask if anyone is interested in testing this script for me.

    I don't have a brother printer, sorry.

    But I wonder what is the issue if the script is written for bash. So
    what? I assume that the SHEBANG specifies bash, not posix. I have
    scripts in my system that specify a different shell. That's not a
    problem, each script uses the shell it was designed for, and I have all
    of them installed, space is not a problem anymore.

    Bash supports a superset of POSIX shell. Ash supports a different superset
    of POSIX shell. Korn Shell supports a superset of POSIX shell that's different from both the Bash and Ash supersets.

    What's common to all these is the POSIX shell subset, which works the same
    way in all three shells.

    Brother released it's script in Bash, with bash-isms all around. That
    makes using this script on a system /that lacks bash/ difficult, as
    someone has to go through the script and change all those bash-isms to something else.

    The systems I use have /bin/sh linked to /bin/ash. Yours might have
    /bin/sh linked to /bin/bash. In any case, I prefer that the utility
    be written in the /common/ subset (as set by POSIX) so that, when
    distributed, it doesn't require additional site-specific modifications
    just to work.




    It replaces /only/ the /usr/bin/brpcfax script (symlinked to
    /opt/brother/fax/brmfcfax/command/brpcfax), and, in addition to being a
    drop in replacement for brpcfax, is
    a) written entirely as a POSIX shell script
    b) written to allow user selection of the fax printer queue
    (where the sysadmin has configured CUPS or LPR(NG) to use a different
    queue name for the Brother FAX driver),
    c) handles multiple documents (recognizing restrictions of the Brother
    Fax driver),
    d) properly handles commandline arguments (including file paths) that
    include embedded spaces, and
    e) returns the exit code of the underlying lpr command, rather than
    a fixed 0 returncode

    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.

    I hope they answer and accept your contribution :-)

    Brother answered all right:
    "Thanks for reaching Brother Canada and for that piece of information.
    Do feel free to share this with the community.
    Please contact us if we can be of any further help or if you have any other questions."

    :-)
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Wed Apr 22 21:48:41 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-22 21:41, Lew Pitcher wrote:
    On Wed, 22 Apr 2026 21:24:56 +0200, Carlos E.R. wrote:

    On 2026-04-20 05:04, Lew Pitcher wrote:
    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have >>> installed the appropriate Brother "driver" packages to use it under CUPS. >>>
    One of the packages (the brmfcfaxdrv-2.0.2 "Fax" driver package) includes >>> a commandline user script ("brpcfax")to "print to fax", that seems to have >>> been written by someone with only a rudimentary concept of what users would >>> use it for. Written not in POSIX shell, but in bash, it queues documents to >>> a fixed-name print queue ("BRFAX") to be faxed by the printer attached to >>> this queue.

    The script, while serviceable, seemed to me to be only just barely adequate >>> to it's task, and I have endeavoured to rewrite it so as to provide a few >>> more features and a fair bit more flexibility.

    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like >>> to ask if anyone is interested in testing this script for me.

    I don't have a brother printer, sorry.

    But I wonder what is the issue if the script is written for bash. So
    what? I assume that the SHEBANG specifies bash, not posix. I have
    scripts in my system that specify a different shell. That's not a
    problem, each script uses the shell it was designed for, and I have all
    of them installed, space is not a problem anymore.

    Bash supports a superset of POSIX shell. Ash supports a different superset
    of POSIX shell. Korn Shell supports a superset of POSIX shell that's different
    from both the Bash and Ash supersets.

    What's common to all these is the POSIX shell subset, which works the same way in all three shells.

    Brother released it's script in Bash, with bash-isms all around. That
    makes using this script on a system /that lacks bash/ difficult, as
    someone has to go through the script and change all those bash-isms to something else.

    Linux machines without bash do not exist, unless you hate bash and
    remove it.


    The systems I use have /bin/sh linked to /bin/ash. Yours might have
    /bin/sh linked to /bin/bash. In any case, I prefer that the utility
    be written in the /common/ subset (as set by POSIX) so that, when distributed, it doesn't require additional site-specific modifications
    just to work.


    A script that starts with #!/bin/bash will just work anywhere.





    It replaces /only/ the /usr/bin/brpcfax script (symlinked to
    /opt/brother/fax/brmfcfax/command/brpcfax), and, in addition to being a
    drop in replacement for brpcfax, is
    a) written entirely as a POSIX shell script
    b) written to allow user selection of the fax printer queue
    (where the sysadmin has configured CUPS or LPR(NG) to use a different >>> queue name for the Brother FAX driver),
    c) handles multiple documents (recognizing restrictions of the Brother
    Fax driver),
    d) properly handles commandline arguments (including file paths) that
    include embedded spaces, and
    e) returns the exit code of the underlying lpr command, rather than
    a fixed 0 returncode

    If there's interest, please respond, and I will send (or post) the
    man page, the script, and the GPL v2 licence that goes with it.

    I hope they answer and accept your contribution :-)

    Brother answered all right:
    "Thanks for reaching Brother Canada and for that piece of information.
    Do feel free to share this with the community.
    Please contact us if we can be of any further help or if you have any other questions."

    :-)

    :-)
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Thu Apr 23 01:14:52 2026
    From Newsgroup: comp.os.linux.misc

    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:
    [snip]

    Linux machines without bash do not exist, unless you hate bash and
    remove it.

    I'm happy that you are so confident about that.

    I do not share that confidence and prefer to ensure that my public
    scripts work with whatever shell the installation has to offer.
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From J.O. Aho@[email protected] to comp.os.linux.misc on Thu Apr 23 10:09:21 2026
    From Newsgroup: comp.os.linux.misc

    On 22/04/2026 16.25, Lew Pitcher wrote:
    On Mon, 20 Apr 2026 03:04:23 +0000, Lew Pitcher wrote:

    Recently, I acquired a Brother MFC printer (Brother MFC-L8610CDW), and have >> installed the appropriate Brother "driver" packages to use it under CUPS.
    [snip]
    I have tested this rewrite on my own systems, to my own satisfaction. However,
    I'm not so vain as to think that what I've coded is universal. So, I'd like >> to ask if anyone is interested in testing this script for me.
    [snip]

    In recognition of the niche (and declining) status of FAX, and the especially niche status of "print to fax" through a Brother MFC printer
    Things gets a bit more niche as there are so many options out there and
    even within a brand things can work differently between models.

    I once supplied an AUR with printer drivers for my printer, all the
    downloads are made by me (the AUR simplified the driver install on
    multiple computers), don't think there are many Linux users with bigger
    office grade printers.
    --
    //Aho
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@[email protected] to comp.os.linux.misc on Thu Apr 23 08:22:05 2026
    From Newsgroup: comp.os.linux.misc

    On Wed, 22 Apr 2026 14:27:57 -0000 (UTC), Lew Pitcher wrote:

    eval lpr -P "${FAXPRINTER}" -o fax-number="${FAXTARGET}" $LPR_ARGS $FAX_DOC

    I don’t understand why you’re using “eval”. Variable substitutions inside quotes do not undergo word-splitting or interpretation of shell specials, but that guarantee is gone once eval comes into the picture.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Allodoxaphobia@[email protected] to comp.os.linux.misc on Thu Apr 23 18:35:32 2026
    From Newsgroup: comp.os.linux.misc

    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    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

    Jonesy
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Thu Apr 23 20:05:41 2026
    From Newsgroup: comp.os.linux.misc

    On Thu, 23 Apr 2026 18:35:32 +0000, Allodoxaphobia wrote:

    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    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

    I'm not so sure about that.

    From what I can see, the BSD env(1) command does the same
    thing as the Linux/GNU env(1) command: it gives you a
    way to alter the environment variables passed to a command
    (OpenBSD: "env executes utility after modifying the environment
    as specified on the command line."
    FreeBSD: "The env utility executes another utility after
    modifying the environment as specified on the
    command line."
    NetBSD: "env executes utility, with the given arguments,
    after modifying the environment as specified on
    the command line."
    )
    Your "'universal', 'smart'" way doesn't specify any
    modifications to the environment. It appears to be effectivly
    useless.

    Then, of course, is the dependence on the Bourne-again shell.
    Hardly "universal", and not so "smart", unless either the
    script is written /for/ the Bourn-again Shell, or the script
    is written to POSIX shell standards. If, for instance, the
    script is written for Korn Shell, then your 'universal' and
    'smart' way probably would encounter shell syntax errors in
    the body of the script.

    OTOH, if you meant that your representative hashbang was
    the "'universal', 'smart'" way to run a Bourne-again Shell
    script through a hashbang, then I'd say it only makes
    half the grade (unless I'm misunderstanding the utility
    of the env(1) utility).
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Thu Apr 23 22:30:27 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-23 20:35, Allodoxaphobia wrote:
    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    A script that starts with #!/bin/bash will just work anywhere.

    Well, not in any *BSD

    Not Linux :-)


    The 'universal', 'smart' way is: #!/usr/bin/env bash

    I've never seen it.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Thu Apr 23 20:53:59 2026
    From Newsgroup: comp.os.linux.misc

    On Thu, 23 Apr 2026 22:30:27 +0200, Carlos E.R. wrote:

    On 2026-04-23 20:35, Allodoxaphobia wrote:
    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    A script that starts with #!/bin/bash will just work anywhere.

    Well, not in any *BSD

    Not Linux :-)


    The 'universal', 'smart' way is: #!/usr/bin/env bash

    I've never seen it.

    If I understand the use of /usr/bin/env correctly,
    in /this/ case, it will locate bash(1) on the user's
    PATH. This implies that bash(1) /is not/ located
    in a fixed location (such as /bin, as per your hashbang),
    and that env(1) /is/ located in a fixed location
    (/usr/bin/env).

    From what I can find out, the default shell in
    BSD is the Almquist shell (ash(1)), and bash
    is an extra that has to be explicitly installed
    (looks like it goes in /usr/local/bin).
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Thu Apr 23 23:05:14 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-23 22:53, Lew Pitcher wrote:
    On Thu, 23 Apr 2026 22:30:27 +0200, Carlos E.R. wrote:
    On 2026-04-23 20:35, Allodoxaphobia wrote:
    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    A script that starts with #!/bin/bash will just work anywhere.

    Well, not in any *BSD

    Not Linux :-)


    The 'universal', 'smart' way is: #!/usr/bin/env bash

    I've never seen it.

    If I understand the use of /usr/bin/env correctly,
    in /this/ case, it will locate bash(1) on the user's
    PATH. This implies that bash(1) /is not/ located
    in a fixed location (such as /bin, as per your hashbang),
    and that env(1) /is/ located in a fixed location
    (/usr/bin/env).

    From what I can find out, the default shell in
    BSD is the Almquist shell (ash(1)), and bash
    is an extra that has to be explicitly installed
    (looks like it goes in /usr/local/bin).

    Well, still a script that declares that uses bash will be fine.
    Everything you install has dependencies, anyhow, so just one more.

    What is not right is declare in a script that it uses the common shell,
    and then have bashisms inside.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@[email protected] to comp.os.linux.misc on Thu Apr 23 22:13:19 2026
    From Newsgroup: comp.os.linux.misc

    On Thu, 23 Apr 2026 23:05:14 +0200, Carlos E.R. wrote:

    [snip]
    What is not right is declare in a script that it uses the common shell,
    and then have bashisms inside.

    Agreed. That's why my script does /not/ have bashisms inside.

    It uses the (POSIX shell) common subset that ash, bash, dash, ksh,
    and zsh all support.
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@[email protected] to comp.os.linux.misc on Fri Apr 24 04:38:27 2026
    From Newsgroup: comp.os.linux.misc

    On 23 Apr 2026 18:35:32 GMT, Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@[email protected] to comp.os.linux.misc on Fri Apr 24 04:39:22 2026
    From Newsgroup: comp.os.linux.misc

    On Thu, 23 Apr 2026 20:53:59 -0000 (UTC), Lew Pitcher wrote:

    If I understand the use of /usr/bin/env correctly, in /this/ case,
    it will locate bash(1) on the user's PATH. This implies that bash(1)
    /is not/ located in a fixed location (such as /bin, as per your
    hashbang), and that env(1) /is/ located in a fixed location
    (/usr/bin/env).

    What if it’s not?
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Richard Kettlewell@[email protected] to comp.os.linux.misc on Fri Apr 24 08:45:15 2026
    From Newsgroup: comp.os.linux.misc

    Lawrence D’Oliveiro <[email protected]d> writes:
    Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    How often does your computer send faxes before /usr is mounted? (Or at
    all? Are you posting from the 1980s?)

    Anyway, the answer is you edit the #! line to point to /bin/bash or
    whatever, and move on with your life.
    --
    https://www.greenend.org.uk/rjk/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Fri Apr 24 10:57:31 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-24 06:38, Lawrence D’Oliveiro wrote:
    On 23 Apr 2026 18:35:32 GMT, Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    Well, that is why #!/bin/bash is used instead.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From The Natural Philosopher@[email protected] to comp.os.linux.misc on Fri Apr 24 10:31:57 2026
    From Newsgroup: comp.os.linux.misc

    On 24/04/2026 09:57, Carlos E.R. wrote:
    On 2026-04-24 06:38, Lawrence D’Oliveiro wrote:
    On 23 Apr 2026 18:35:32 GMT, Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    Well, that is why #!/bin/bash is used instead.


    the use of a separate partition for /usr goes back to when /home was not
    the default place for user data.

    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    In short its all theoretical cockwombling 'what ifs' rather than a real
    life issue...
    --
    “There are two ways to be fooled. One is to believe what isn’t true; the other is to refuse to believe what is true.”

    —Soren Kierkegaard

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Fri Apr 24 11:43:48 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-24 11:31, The Natural Philosopher wrote:
    On 24/04/2026 09:57, Carlos E.R. wrote:
    On 2026-04-24 06:38, Lawrence D’Oliveiro wrote:
    On 23 Apr 2026 18:35:32 GMT, Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    Well, that is why #!/bin/bash is used instead.


    the use of a separate partition for /usr goes back to when /home was not
    the default place for user data.

    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    In short its all theoretical cockwombling 'what ifs' rather than a real
    life issue...

    I do use a number of partitions. I have 4 rotating rust disks on this
    system. I'm not using now a /usr partition, I removed that one because
    it was a pain. And I used it before because I had to enlarge the system,
    and root was relatively small.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Fri Apr 24 11:45:42 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-24 11:31, The Natural Philosopher wrote:
    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    For example, that if you want to change the partition parameters in a
    non full disk partition, you can move the contents to other partitions,
    then reformat the target, and restore the contents.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From The Natural Philosopher@[email protected] to comp.os.linux.misc on Fri Apr 24 11:11:13 2026
    From Newsgroup: comp.os.linux.misc

    On 24/04/2026 10:43, Carlos E.R. wrote:
    On 2026-04-24 11:31, The Natural Philosopher wrote:
    On 24/04/2026 09:57, Carlos E.R. wrote:
    On 2026-04-24 06:38, Lawrence D’Oliveiro wrote:
    On 23 Apr 2026 18:35:32 GMT, Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    Well, that is why #!/bin/bash is used instead.


    the use of a separate partition for /usr goes back to when /home was
    not the default place for user data.

    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    In short its all theoretical cockwombling 'what ifs' rather than a
    real life issue...

    I do use a number of partitions. I have 4 rotating rust disks on this system. I'm not using now a /usr partition, I removed that one because
    it was a pain. And I used it before because I had to enlarge the system,
    and root was relatively small.


    Well so did I some time in the early 1990s
    Bur seriously, I wouldn't be using spinning rust from that era today.
    Too damned dangerous in terms of reliability...
    --
    Ideas are more powerful than guns. We would not let our enemies have
    guns, why should we let them have ideas?

    Josef Stalin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From The Natural Philosopher@[email protected] to comp.os.linux.misc on Fri Apr 24 11:11:54 2026
    From Newsgroup: comp.os.linux.misc

    On 24/04/2026 10:45, Carlos E.R. wrote:
    On 2026-04-24 11:31, The Natural Philosopher wrote:
    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    For example, that if you want to change the partition parameters in a
    non full disk partition, you can move the contents to other partitions,
    then reformat the target, and restore the contents.

    That's what USB drives are for...
    --
    Ideas are more powerful than guns. We would not let our enemies have
    guns, why should we let them have ideas?

    Josef Stalin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Fri Apr 24 12:51:05 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-24 12:11, The Natural Philosopher wrote:
    On 24/04/2026 10:45, Carlos E.R. wrote:
    On 2026-04-24 11:31, The Natural Philosopher wrote:
    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    For example, that if you want to change the partition parameters in a
    non full disk partition, you can move the contents to other
    partitions, then reformat the target, and restore the contents.

    That's what USB drives are for...


    Mine are not empty.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Fri Apr 24 12:50:38 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-24 12:11, The Natural Philosopher wrote:
    On 24/04/2026 10:43, Carlos E.R. wrote:
    On 2026-04-24 11:31, The Natural Philosopher wrote:
    On 24/04/2026 09:57, Carlos E.R. wrote:
    On 2026-04-24 06:38, Lawrence D’Oliveiro wrote:
    On 23 Apr 2026 18:35:32 GMT, Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    Well, that is why #!/bin/bash is used instead.


    the use of a separate partition for /usr goes back to when /home was
    not the default place for user data.

    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    In short its all theoretical cockwombling 'what ifs' rather than a
    real life issue...

    I do use a number of partitions. I have 4 rotating rust disks on this
    system. I'm not using now a /usr partition, I removed that one because
    it was a pain. And I used it before because I had to enlarge the
    system, and root was relatively small.


    Well so did I some time in the early 1990s
    Bur seriously, I wouldn't be using spinning rust from that era today.
    Too damned dangerous in terms of reliability...

    I am using rotating rust from current times because those sizes are not feasible with SSD unless you are a millionaire. The system itself is on
    a 5th disk, nvme technology.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From The Natural Philosopher@[email protected] to comp.os.linux.misc on Fri Apr 24 13:42:58 2026
    From Newsgroup: comp.os.linux.misc

    On 24/04/2026 11:51, Carlos E.R. wrote:
    On 2026-04-24 12:11, The Natural Philosopher wrote:
    On 24/04/2026 10:45, Carlos E.R. wrote:
    On 2026-04-24 11:31, The Natural Philosopher wrote:
    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    For example, that if you want to change the partition parameters in a
    non full disk partition, you can move the contents to other
    partitions, then reformat the target, and restore the contents.

    That's what USB drives are for...


    Mine are not empty.

    Well buy one that is...
    --
    Labour - a bunch of rich people convincing poor people to vote for rich
    people by telling poor people that "other" rich people are the reason
    they are poor.

    Peter Thompson

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bobbie Sellers@[email protected] to comp.os.linux.misc on Fri Apr 24 18:53:20 2026
    From Newsgroup: comp.os.linux.misc



    On 4/24/26 02:45, Carlos E.R. wrote:
    On 2026-04-24 11:31, The Natural Philosopher wrote:
    I cant see any advantage in partitioning it in a modern context with
    large - and fast - SSDs.

    For example, that if you want to change the partition parameters in a
    non full disk partition, you can move the contents to other partitions,
    then reformat the target, and restore the contents.

    Well I would say that if you need a disk repair for some reason, smaller
    partitions as in /, /home/user, /home/user/data and /media/backup will be recovered a lot faster. I have never recovered a 500 GB disk but I ran a recovery program on a rerabyte rust disk and it took over 24 hours. to
    get to
    the point that I needed another terabyte disk to which to write the results.

    Too much fun... not ever enough money...

    bliss- Dell Precision 7730- PCLOS 2026.04- Linux 6.12.83 pclos1- KDE
    Plasma 6.6.4
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From =?UTF-8?Q?St=C3=A9phane?= CARPENTIER@[email protected] to comp.os.linux.misc on Sat Apr 25 09:39:25 2026
    From Newsgroup: comp.os.linux.misc

    Le 23-04-2026, Lew Pitcher <[email protected]> a écrit :
    On Thu, 23 Apr 2026 18:35:32 +0000, Allodoxaphobia wrote:

    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    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

    I'm not so sure about that.

    From what I can see, the BSD env(1) command does the same
    thing as the Linux/GNU env(1) command: it gives you a
    way to alter the environment variables passed to a command
    [/SNIP/]
    Your "'universal', 'smart'" way doesn't specify any
    modifications to the environment. It appears to be effectivly
    useless.

    It's clearly a good way to launch some shitty programming languages like python. As you can't put #!python in the shebang (I just tried to be
    sure), the only way to have a script which can run either in a virtual environment or with the binary of your distro is to use the env command.
    I mean without modifying your script.

    For bash, the one of my distro is /bin/bash when the one I'm using in a terminal is /home/stef/.guix-profile/bin/bash so the env command will
    launch a different shell than the #!/bin/bash shebang. As my distro and
    guix are mostly up to date (5.3.9 for archlinux vs. 5.2.37 for guix) I'm
    not sure the difference is important. But for python with the poorly
    managed dependencies, it changes a lot.

    (unless I'm misunderstanding the utility of the env(1) utility).

    I don't know if you misunderstand its utility, but it looks like there
    can be situations of which you are not aware. I'm not saying it should
    be used in each shebang, but it can be useful without modifying the environment.

    Because I don't want to write "./venv/bin/python script.py" each time
    I want to run my script. And if we are two working on the same script
    with a different path for the venv directory, each commit will change
    the shebang if we don't use the env command. So, I know, the issue lies
    more with python, but it's a valid example nonetheless.
    --
    Si vous avez du temps à perdre :
    https://scarpet42.gitlab.io
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From =?UTF-8?Q?St=C3=A9phane?= CARPENTIER@[email protected] to comp.os.linux.misc on Sat Apr 25 09:41:33 2026
    From Newsgroup: comp.os.linux.misc

    Le 23-04-2026, Carlos E.R. <[email protected]d> a écrit :
    On 2026-04-23 20:35, Allodoxaphobia wrote:
    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    A script that starts with #!/bin/bash will just work anywhere.

    Well, not in any *BSD

    Not Linux :-)


    The 'universal', 'smart' way is: #!/usr/bin/env bash

    I've never seen it.

    Lucky guy. I discovered it when I started to work on some python scripts
    with others.
    --
    Si vous avez du temps à perdre :
    https://scarpet42.gitlab.io
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From =?UTF-8?Q?St=C3=A9phane?= CARPENTIER@[email protected] to comp.os.linux.misc on Sat Apr 25 09:51:05 2026
    From Newsgroup: comp.os.linux.misc

    Le 24-04-2026, Richard Kettlewell <[email protected]d> a écrit :
    Lawrence D’Oliveiro <[email protected]d> writes:
    Allodoxaphobia wrote:

    Well, not in any *BSD

    The 'universal', 'smart' way is: #!/usr/bin/env bash

    What if /usr is not yet mounted?

    How often does your computer send faxes before /usr is mounted? (Or at
    all? Are you posting from the 1980s?)

    He likes answering things just for fun.

    Anyway, the answer is you edit the #! line to point to /bin/bash or
    whatever, and move on with your life.

    I don't guess it would be a good answer. If you are logged and your /usr
    is not mounted, you have real issues. I'm not that sure that changing
    the shebang will help, because a lot of things will be broken. If your
    /usr is not yet mounted when you are logged, I'd say you have to mount
    it to have a useful computer.

    I won't rename it just to see how much it breaks everything, but I guess
    it would be pretty bad.
    --
    Si vous avez du temps à perdre :
    https://scarpet42.gitlab.io
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Sat Apr 25 13:57:42 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-04-25 11:41, Stéphane CARPENTIER wrote:
    Le 23-04-2026, Carlos E.R. <[email protected]d> a écrit :
    On 2026-04-23 20:35, Allodoxaphobia wrote:
    On Wed, 22 Apr 2026 21:48:41 +0200, Carlos E.R. wrote:

    A script that starts with #!/bin/bash will just work anywhere.

    Well, not in any *BSD

    Not Linux :-)


    The 'universal', 'smart' way is: #!/usr/bin/env bash

    I've never seen it.

    Lucky guy. I discovered it when I started to work on some python scripts
    with others.


    OT
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From jayjwa@[email protected] to comp.os.linux.misc on Sat Apr 25 12:01:22 2026
    From Newsgroup: comp.os.linux.misc

    Allodoxaphobia <[email protected]> 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!"
    --- Synchronet 3.21f-Linux NewsLink 1.2