Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #244174

Re: Hyper-typematic and Firefox responsiveness in Weston.

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: Hyper-typematic and Firefox responsiveness in Weston.
Date 2022-01-18 13:30 +0100
Message-ID <DGVMH-78n-5@gated-at.bofh.it> (permalink)
References <DAhoR-521-1@gated-at.bofh.it> <DEQHo-4aF-9@gated-at.bofh.it> <DGOrM-1WU-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 17, 2022 at 08:13:58PM -0800, peter@easthope.ca wrote:
> This shell function is defined in .bashrc and used to start firefox.
> 
> fire () { case $# in
>   0) /usr/bin/firefox-esr --display=:0 file:///home/peter/MY/Peter.html#Links & ;;
>   1) /usr/bin/firefox-esr --display=:0 $1 & ;;
>   *) echo "Too many arguments." ;; esac }

"$1" should be quoted there, and the } will need to be on a separate line,
or else you'll need a semicolon between esac and }.

I'd also advise against hard-coding paths like /usr/bin/firefox-esr in
your dot files.  Paths can change over time.  Just use firefox-esr.

> This might be better.
> alias fire='exec /usr/bin/firefox-esr --display=:0 "$@"'

Bash aliases don't take positional parameters like that.  Also, you
wouldn't want "exec" here -- running this alias would terminate the shell.

Since bash aliases don't take positional parameters, there's really no
way to do the background thing with arguments using an alias.  So, stick
with the function here.  As the bash(1) manual says,

       There  is no mechanism for using arguments in the replacement text.  If
       arguments are needed, a shell function should be  used  (see  FUNCTIONS
       below).

And,

       For almost every purpose, aliases are superseded by shell functions.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2021-12-31 05:10 +0100
  Re: Hyper-typematic and Firefox responsiveness in Weston. Georgi Naplatanov <gosho@oles.biz> - 2021-12-31 21:50 +0100
    Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-01 18:40 +0100
      Re: Hyper-typematic and Firefox responsiveness in Weston. Georgi Naplatanov <gosho@oles.biz> - 2022-01-01 19:10 +0100
  Re: Hyper-typematic and Firefox responsiveness in Weston. Stefan Monnier <monnier@iro.umontreal.ca> - 2022-01-01 22:30 +0100
    Re: Hyper-typematic and Firefox responsiveness in Weston. Curt <curty@free.fr> - 2022-01-02 14:50 +0100
    Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-02 18:30 +0100
    Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-26 15:30 +0100
  Re: Hyper-typematic and Firefox responsiveness in Weston. Andrei POPESCU <andreimpopescu@gmail.com> - 2022-01-12 19:40 +0100
    Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-18 05:40 +0100
      Re: Hyper-typematic and Firefox responsiveness in Weston. Greg Wooledge <greg@wooledge.org> - 2022-01-18 13:30 +0100
        Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-18 17:30 +0100
          Re: Hyper-typematic and Firefox responsiveness in Weston. Andrei POPESCU <andreimpopescu@gmail.com> - 2022-01-21 10:20 +0100
            Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-24 00:50 +0100
              Re: Hyper-typematic and Firefox responsiveness in Weston. Tixy <tixy@yxit.co.uk> - 2022-01-24 09:00 +0100
            Re: Hyper-typematic and Firefox responsiveness in Weston. peter@easthope.ca - 2022-01-24 19:10 +0100

csiph-web