From: Greg Wooledge
Date: Fri, 16 May 2025 11:41:00 -0400
> Why are you setting the DISPLAY variable?
# Cannot parse arguments: Cannot open display:
wasn't usable.
> ... at best, it's only viable in a very specialized setup.
Correct. A specialized setup and I'm working on a better so
From: Greg Wooledge
Date: Fri, 16 May 2025 11:41:00 -0400
> Why are you setting the DISPLAY variable?
# Cannot parse arguments: Cannot open display:
wasn't usable.
> ... at best, it's only viable in a very specialized setup.
Correct. A specialized setup and I'm working on a better so
From: Will Mengarini
Date: Thu, 15 May 2025 10:07:19 -0700
> ... evince can display multiple URLs ...
Hadn't noticed that. Revised to this.
ev () { /usr/bin/evince "$@" & }
Thx, ... p.
--
VoIP: +1 604 670 0140
work: en.wikibooks.org/wiki/User:PeterEasthope
From: Lee
Date: Thu, 15 May 2025 13:02:27 -0400
> quoting $1
Revised to this.
ev () { /usr/bin/evince "$@" & }
Thx, ... p.
--
VoIP: +1 604 670 0140
work: en.wikibooks.org/wiki/User:PeterEasthope
On 15/05/2025 22:42, pe...@easthope.ca wrote:
Given this function.
You have not described use cases
ev () { case $# in
0) /usr/bin/evince --display=:0 ;;
1) /usr/bin/evince --display=:0 $1 ;;
*) echo "Too many arguments." ;; esac }
Can improvements be suggested?
Install shellcheck
On 5/15/25 11:42, pe...@easthope.ca wrote:
Hi,
Given this function.
ev () { case $# in
0) /usr/bin/evince --display=:0 ;;
1) /usr/bin/evince --display=:0 $1 ;;
*) echo "Too many arguments." ;; esac }
Can improvements be suggested?
When you refer to a variable you should wrap it i
* pe...@easthope.ca [25-05/15=Th 08:42 -0700]:
>> ev () { case $# in
>> 0) /usr/bin/evince --display=:0 ;;
>> 1) /usr/bin/evince --display=:0 $1 ;;
>> *) echo "Too many arguments." ;; esac }
>> Can improvements be suggested?
* ? [25-05/15=Th 18:23 +0200]:
> you can shorten ev to
> ev(){ ev
pe...@easthope.ca wrote:
> Hi,
>
> Given this function.
>
> ev () { case $# in
> 0) /usr/bin/evince --display=:0 ;;
> 1) /usr/bin/evince --display=:0 $1 ;;
> *) echo "Too many arguments." ;; esac }
>
> Can improvements be suggested?
"Too many arguments." doesn't seem quite right. If evinc
On Thu, May 15, 2025 at 12:00 PM peter wrote:
>
> Hi,
>
> Given this function.
>
> ev () { case $# in
> 0) /usr/bin/evince --display=:0 ;;
> 1) /usr/bin/evince --display=:0 $1 ;;
> *) echo "Too many arguments." ;; esac }
>
> Can improvements be suggested?
quoting $1
I don't know about evinc
you can shorten ev to
ev(){ evince -d ${DISPLAY=:0} ${1+"$@"};}
you might wanna background it from your tty
ev() { evince ${1+"$@"}&}
unless you need to see the display errors
or have an rm $pdf waiting to not fire prematurely
Op do 15 mei 2025 om 18:00 schreef :
> ev () { case $# in
> 0) /
pe...@easthope.ca writes:
> In a realistic case, there are more than two exclusion patterns.
> Comments or suggestions about the two possibilities? Astonishingly
> better ideas? =8~o
Put the exlucde patterns in a file and use --exclude-from=file? Works
for me, so far with tar and bup, rsync h
From: Greg Wooledge
Date: Sat, 7 Dec 2024 11:08:54 -0500
> "${exclusions[@]//#/--exclude=}"
In a shell script; correct?
I'm making a shell function declared in .bashrc. Numerous syntactical
variations were unsuccessful. Maybe a simple escape syntax is needed.
Stretched a test out
On Sat, Dec 07, 2024 at 06:19:20 -0700, pe...@easthope.ca wrote:
> From: Greg Wooledge
> Date: Fri, 6 Dec 2024 18:44:04 -0500
> > Store the exclusions in an ARRAY, not in a string. Then create a
> > second array which contains the spelled-out --exclude=... options.
>
> Unfamiliar to me &
From: Greg Wooledge
Date: Fri, 6 Dec 2024 18:44:04 -0500
> Store the exclusions in an ARRAY, not in a string. Then create a
> second array which contains the spelled-out --exclude=... options.
Unfamiliar to me & interesting. What benefits outweigh the additional
complexity?
Thanks,
On Fri 06 Dec 2024 at 18:30:27 (-0500), pe...@easthope.ca wrote:
> Hypothetical shell usages (1) & (2).
>
> (1)
> Restore() { \
> source=somewhere/Backup/ ;
> destination=elsewhere/workingDirectory ;
> rsync \
> --exclude '*.mp3' \
> --exclude '*.mp4' \
> -anuv $source $destination ; }
On 12/6/24 18:46, e...@gmx.us wrote:
> overengineered
Greg's solution is better.
On Fri, Dec 06, 2024 at 18:46:06 -0500, e...@gmx.us wrote:
> You could do something
> overengineered like defining an array "excludepatterns" for patterns, and
> then doing something like
>
> rsync \
> $(for pattern in ${excludepatterns[@]} ; do
> echo -- "--exclude '$pattern'"
> done)
>
> Mo
On 12/6/24 17:11, pe...@easthope.ca wrote:
These
> rsync \
> --exclude '*.mp3' \
>--exclude '*.mp4' \
> rsync \
> --exclude=$exclusions
are not the same. In the first one you have "--exclude" for each pattern,
and in the second you have it once. I suspect the first one is correct,
On Fri, Dec 06, 2024 at 15:11:51 -0700, pe...@easthope.ca wrote:
> (2)
> exclusions='*.mp3'
> exclusions+='*.mp4'
> Restore() { \
> source=somewhere/Backup/ ;
> echo "source is $source." ;
> destination=elsewhere/workingDirectory ;
> echo "destination is $destination." ;
> rsync \
> -an
19 matches
Mail list logo