On Tue May 14 18:11:16 2024 Страхиња Радић wrote:
> Antipatterns are bad. I don't mean the ellipsis in `ls -l ...`. I mean
> things like
>
> cat file | grep hello | cat | sed 's/hello/world/g' | cat - > output
>
> for file in `echo `ls *` `; do echo $file; done
>
> ls -l | awk '{ print $5 }'
Дана 24/05/14 11:52AM, Walter Alejandro Iglesias написа:
> I learned about the convenience of adding the '-r' option in the "while
> read" loop many years ago when I was writing a script to convert roff to
> html, the problem aroused with the backslash in roff comments (.\").
That's more or less t
On Tue May 14 11:11:33 2024 wrote:
> When `while ... read ...` idiom is used, it is advisable to clear IFS
> to turn off field splitting, and use -r to avoid interpretation of
> backslash sequences in the input:
>
> while IFS= read -r dir; do # ...
>
> Back to parsing the output of ls(1) (
Andreas Kähäri writes:
i'm not sure why you're addressing this to me, as i'm not the
OP.
It's addressed to the thread in general.
Your response quoted me, then made use of the word 'you'. Which
you - and yes, i mean you, Andreas, specifically - have again done
below:
That said, yes, min
On Sun May 12 21:50:12 2024 Martin Schröder wrote:
>
> If a line begins with "- " (dash, space) or "+ " (plus, space),
> then the type of rule is being explicitly specified as an exclude
> or an include (respectively). Any rules without such a prefix are
> taken to be an include.
I'd read
Am So., 12. Mai 2024 um 21:18 Uhr schrieb Walter Alejandro Iglesias
:
> On Sun May 12 20:58:43 2024 Andreas Kähäri wrote
> > With rsync(1):
> >
> > rsync -n -aim --delete-excluded \
> > --include-from=list \
> > --include='*/' \
> > --exclude='*' \
>
On Sun May 12 20:58:43 2024 Andreas Kähäri wrote
> With rsync(1):
>
> rsync -n -aim --delete-excluded \
> --include-from=list \
> --include='*/' \
> --exclude='*' \
> source/ target
>
I don't understand what your command does exactly.
On Sun, May 12, 2024 at 01:40:25PM +0200, Walter Alejandro Iglesias wrote:
> > Unix development. Given that i've been using computers for a few
> > decades, i still instinctively don't use spaces in filenames, even
> > though they're very much allowed. But of course, that's not what
> > most of
Andreas Kähäri writes:
The external env(1) utility will only ever list environment
variables.
The IFS variable does not need to be exported as an environment
variable
as it's only ever used by the current shell (and any new shell
would
reset it).
To list all variables in a shell, use the bu
Страхиња Радић writes:
Дана 24/05/12 07:31PM, Alexis написа:
Omitting -r as a parameter to read would make it interpret
backscape
sequences, which would make the directory name in the filesystem
different than the one command/script operates on, which is most
likely undesired (unless the
Дана 24/05/12 07:31PM, Alexis написа:
> i wondered about that in this context. If people putting odd / inappropriate
> things in directory names are a concern ("weird characters", as you wrote
> upthread), what do we do about the possibility of someone having consciously
> put e.g. a \t in a direct
On Sun, May 12, 2024 at 08:08:17PM +1000, Alexis wrote:
> Andreas Kähäri writes:
>
> > Well, that's one way to control this trainwreck of a script; just say
> > that any name containing "inappropriate" characters aren't allowed!
> >
> > May I ask why you don't simply use rsync(1) (or even openrs
On Sun, May 12, 2024 at 07:56:55PM +1000, Alexis wrote:
> Andreas Kähäri writes:
>
> > The ksh(1) shell sets IFS by default to a space, tab and a newline
> > character.
>
> Those are the defaults used when IFS is not set _as a variable_. If you log
> in, and run env(1), in the absence of any man
On Sun May 12 13:22:13 2024 Alexis wrote:
> Andreas Kähäri writes:
> > Well, that's one way to control this trainwreck of a script;
> > just say
> > that any name containing "inappropriate" characters aren't
> > allowed!
> >
> > May I ask why you don't simply use rsync(1) (or even
> > openrsync
On Sun, May 12, 2024 at 07:31:41PM +1000, Alexis wrote:
> Страхиња Радић writes:
>
> > When `while ... read ...` idiom is used, it is advisable to clear IFS to
> > turn off field splitting
>
> *nod* Fair point; it's not set by default, so i didn't think to note that
> any manual setting of it sh
On Sun May 12 11:40:05 2024 tux2bsd wrote
> Hi Walter
>
> mktemp makes temporary unique filenames like this:
>
> delete_list=$(mktemp)
> source_list=$(mktemp)
> target_list=$(mktemp)
> # Do your code. If you want to keep something you do
> # that appropriately then:
> rm $delete_list $source_list
Andreas Kähäri writes:
Well, that's one way to control this trainwreck of a script;
just say
that any name containing "inappropriate" characters aren't
allowed!
May I ask why you don't simply use rsync(1) (or even
openrsync(1) from
the OpenBSD base system)?
i'm not sure why you're addres
Andreas Kähäri writes:
The ksh(1) shell sets IFS by default to a space, tab and a
newline
character.
Those are the defaults used when IFS is not set _as a
variable_. If you log in, and run env(1), in the absence of any
manual setting of IFS in .kshrc or whatever, you'll see that IFS
is no
Страхиња Радић writes:
When `while ... read ...` idiom is used, it is advisable to
clear IFS
to turn off field splitting
*nod* Fair point; it's not set by default, so i didn't think to
note that any manual setting of it should be overridden for this.
and use -r to avoid interpretation of
> What about the following, better?
>
> -
> # Remove files from target directory
> date=$(date +%H%M%S)
> delete_list=/tmp/delete_$date
> source_list=/tmp/source_$date
> target_list=/tmp/target_$date
Hi Walter
mktemp makes temporary unique filenames li
Дана 24/05/12 06:17PM, Alexis написа:
> To deal with spaces etc., one could possibly use something along the lines
> of the following kludge; it assumes that \n is relatively unlikely to be
> found in a directory name, and that the directories in $dirs can be
> separated by \n.
>
> cd "$target" &
On Sun May 12 10:07:30 2024 Страхиња Радић wrote:
> A few notes:
>
> - You don't need a backslash after a pipe (|) or a list operator (||
> and &&) - a line ending with a pipe is an incomplete pipeline. So
> (with added quoting):
>
> diff "$source_list" "$target_list" |
> awk '/^> /
Страхиња Радић writes:
Lapsus: the variable dirs should not be quoted here if it
contains more
than one directory to be passed to find. It is vulnerable to
directory
names containing spaces and weird characters, however.
So:
cd "$target" &&
find $dirs | sort | uniq > "$target_l
Дана 24/05/11 10:36PM, Страхиња Радић написа:
> cd "$target" &&
> find "$dirs" | sort | uniq > "$target_list"
Lapsus: the variable dirs should not be quoted here if it contains more
than one directory to be passed to find. It is vulnerable to directory
names containing spaces and weird c
Дана 24/05/11 07:41PM, Walter Alejandro Iglesias написа:
> Today I realized that the loop above is not necesary:
>
> ---
> dirs=$(echo "$files" | grep '/$')
>
> cd && find $dirs | sort | uniq > $source_list
> cd $target && find $dirs | sort
On Sat May 11 20:20:04 2024 "Robert B. Carleton" wrote:
> Another tool you might want to take a look at is rdist(1). It's limited
> in some ways, but is a native capability to OpenBSD. It has a long
> history.
>
I've never used rdist(1) either, I will learn about it. Thanks Robert
for mention it
Walter Alejandro Iglesias writes:
> On Fri May 10 08:36:50 2024 Walter Alejandro Iglesias wrote
>> Then I do something like this (simplified for clartiy):
>>
>> [...]
>>
>> dirs=$(echo "$files" | grep '/$')
>>
>> for i in $dirs ; do
>> find $source/$i | sed 's#'$source'##' | sort | uniq > $s
On Fri May 10 08:36:50 2024 Walter Alejandro Iglesias wrote
> Then I do something like this (simplified for clartiy):
>
> [...]
>
> dirs=$(echo "$files" | grep '/$')
>
> for i in $dirs ; do
> find $source/$i | sed 's#'$source'##' | sort | uniq > $source_list
> find $target/$i | sed 's#'
On Fri May 10 08:16:32 2024 "Robert B. Carleton" wrote:
> I'm going to try using pax(1) in copy mode (-rw) as an alternative to
> rsync and cpio when it's local filesystems. I hadn't considered that
> until recently.
This is my dirty solution to add pax a "delete on target" functionality.
I save
Rsync. I also have a root directory in /home to keep local stuff. This is
the same for about 20 machines running obsd and is also distributed by
rsync. Since it is in home, it survives upgrades. Various shell scripts in
/home/root/etc are used to manage the system.
On Wed, May 8, 2024, 11:08 Jan
On May 07 22:15:27, olp...@yahoo.ca wrote:
> I was wondering which programs you use for replicating/copying/syncing
> environments/configs on your openbsd systems with between your desktops (home
> or work) and laptops?
git
> Do you also maintain installeded/removed packages in some standard wa
duplicity
On 2024-05-07 9:09 p.m., Matthew Ernisse wrote:
On Wed, May 08, 2024 at 12:25:43AM +0100, Jo MacMahon said:
I'm interested if anybody has solutions using just the base system
I've had a set of functions in my .profile for about 15 years
that keeps large parts of my home directory av
On 5/7/24 19:25, Jo MacMahon wrote:
I'm interested if anybody has solutions using just the base system - I would
want something like etckeeper or git that was a true version control system,
rather than dump(8)/restore(8) which are backup systems. I'm idly considering
learning CVS for it, and I
On Wed, May 08, 2024 at 12:25:43AM +0100, Jo MacMahon said:
I'm interested if anybody has solutions using just the base
system
I've had a set of functions in my .profile for about 15 years
that keeps large parts of my home directory available and in
sync across Linux, macOS and OpenBSD systems
I'm interested if anybody has solutions using just the base system - I would
want something like etckeeper or git that was a true version control system,
rather than dump(8)/restore(8) which are backup systems. I'm idly considering
learning CVS for it, and I suppose if I'm going to become a true
On 07.05.2024 16:08, Martin Kjær Jørgensen wrote:
Hello,
I was wondering which programs you use for replicating/copying/syncing
environments/configs on your openbsd systems with between your desktops (home
or work) and laptops?
Example programs for this could be syncthing, stow, chezmoi, etc.
Stefan Moran writes:
> dump(8) and restore(8) also worth mentioning; I'm particularly fond of
> restore(8)'s interactive mode that lets you cherrypick what you want to
> import.
I agree. My backups are mostly dump(8) and rsync(1). Out of habit, I've
used cpio(1) in copy mode (-p) for copying fil
rdist
On Wednesday, May 8, 2024 at 12:25:13 a.m. GMT+9, Martin Kjær Jørgensen
wrote:
Hello,
I was wondering which programs you use for replicating/copying/syncing
environments/configs on your openbsd systems with between your desktops (home
or work) and laptops?
Example programs f
On 5/7/24 1:09 PM, Страхиња Радић wrote:
Дана 24/05/07 04:08PM, Martin Kjær Jørgensen написа:
I was wondering which programs you use for
replicating/copying/syncing environments/configs on your openbsd
systems with between your desktops (home or work) and laptops?
git(1), rsync(1).
git push a
dump(8) and restore(8) also worth mentioning; I'm particularly fond of
restore(8)'s interactive mode that lets you cherrypick what you want to
import.
Дана 24/05/07 04:08PM, Martin Kjær Jørgensen написа:
> I was wondering which programs you use for
> replicating/copying/syncing environments/configs on your openbsd
> systems with between your desktops (home or work) and laptops?
git(1), rsync(1).
Hello,
I was wondering which programs you use for replicating/copying/syncing
environments/configs on your openbsd systems with between your desktops (home
or work) and laptops?
Example programs for this could be syncthing, stow, chezmoi, etc.
Do you also maintain installeded/removed packages
42 matches
Mail list logo