From: Frank Steinmetzger <Warp_7@gmx.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Dolphin and adding a option, if it exists.
Date: Tue, 22 Nov 2022 11:07:05 +0100 [thread overview]
Message-ID: <Y3yfSaXVo0pYUStB@tp> (raw)
In-Reply-To: <a03cce6d-fba9-dac8-d035-0a3e0c57895d@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2211 bytes --]
Am Tue, Nov 22, 2022 at 03:59:27AM -0600 schrieb Dale:
> > If you still want to stick to a terminal solution akin to mv, then there is
> > no way around a little script which wraps mv by extracting the extension and
> > filename base. You could also add some “intelligence” with regards to
> > directories, in order to reduce the amount of effort required to use the
> > command—in case your directories follow some schema or are constant.
> >
> >
> > #!/usr/bin/sh
> >
> > [ "$#" -ne "2" ] && exit 1
> > SRC="$1"
> > DST="$2"
> >
> > SRC_EXT="${SRC##*.}"
> > DST_BASE="${DST%.*}"
> >
> > # remove destination for the case that the extensions differ
> > rm "$DST"
> >
> > mv "$SRC" "${DST_BASE}${SRC_EXT}"
> >
>
> I finally got a chance to try this. I saved it and made it executable.
> It runs but gave me this error.
>
>
> dmv torrent/video_name-old-place.mp4 video-name-new-place.mp4
> bash: /bin/dmv: /usr/bin/sh: bad interpreter: No such file or directory
> dale@fireball ~/Desktop/Crypt/Series $
>
>
> My scripting skills are minimal at best. Still, I kinda got what your
> script was doing. Those who have known me for a while understand how
> miraculous that is. ROFL I did some googling. It seems to not be able
> to find the 'shebang' part. Sure enough, sh isn't located in /usr/bin
> here. It's in /bin tho. I edited that line so it can find it. When I
> tried it, it worked but noticed another problem. […]
Well, it would have been boring to provide you with a turn-key solution. ;-)
Congrats on getting it working. In my Arch setup, sh is in /usr/bin. A
flexible solution is to use #!/usr/bin/env sh, which looks the command up
before executing it.
> I added a little . on that last line before the extension bit. I'm a
> happy camper.
Give me a nudge if you want the more luxurious version with interactive
selection of the overwrite destination. I think I already started a
prototype somewhere, but can’t find it right now.
--
Grüße | Greetings | Salut | Qapla’
Please do not share anything from, with or about me on any social network.
The best thing about Sundays is Saturday evening.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-11-22 10:07 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-06 4:39 [gentoo-user] Dolphin and adding a option, if it exists Dale
2022-10-06 7:33 ` Michael
2022-10-06 7:52 ` Wol
2022-10-06 7:57 ` Michael
2022-10-06 8:10 ` Arve Barsnes
2022-10-06 12:45 ` Neil Bothwick
2022-10-06 15:19 ` Ramon Fischer
2022-10-06 15:22 ` Ramon Fischer
2022-10-06 15:24 ` Neil Bothwick
2022-10-06 17:41 ` Dale
2022-10-08 3:44 ` Dale
2022-10-08 8:05 ` Michael
2022-10-08 8:18 ` Dale
2022-10-08 21:02 ` Neil Bothwick
2022-10-08 22:15 ` Dale
2022-10-08 22:20 ` Mark Knecht
2022-10-08 23:20 ` Dale
2022-10-09 7:44 ` Neil Bothwick
2022-10-08 9:10 ` Wols Lists
2022-10-08 9:24 ` Dale
2022-10-10 0:53 ` [gentoo-user] " Grant Edwards
2022-10-08 20:58 ` [gentoo-user] " Neil Bothwick
2022-10-23 6:35 ` Dale
2022-10-23 9:41 ` Frank Steinmetzger
2022-10-23 11:16 ` Dale
2022-10-23 11:57 ` Frank Steinmetzger
2022-10-24 13:49 ` [gentoo-user] " Grant Edwards
2022-10-24 22:08 ` Peter Humphrey
2022-11-22 9:59 ` [gentoo-user] " Dale
2022-11-22 10:07 ` Frank Steinmetzger [this message]
2022-11-22 12:17 ` Dale
[not found] ` <7773a6e5-4b60-495f-8889-411c1a7def96@PRAP251MB0466.EURP251.PROD.OUTLOOK.COM>
2022-11-22 21:58 ` Undeliverable: " Dale
2022-11-23 0:06 ` Wols Lists
2022-11-23 4:32 ` Dale
2023-01-27 13:54 ` Peter Humphrey
2023-01-29 15:18 ` Peter Humphrey
2022-11-23 11:39 ` Frank Steinmetzger
2022-11-23 11:54 ` Dale
2022-11-23 12:00 ` Frank Steinmetzger
2022-11-23 12:16 ` Dale
2022-11-23 13:05 ` Frank Steinmetzger
2022-11-23 18:17 ` Dale
2022-11-24 14:37 ` Michael
2022-11-22 19:14 ` Wol
2022-10-08 20:32 ` Frank Steinmetzger
2022-10-09 6:58 ` Arve Barsnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3yfSaXVo0pYUStB@tp \
--to=warp_7@gmx.de \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox