From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 58427158003 for ; Tue, 22 Nov 2022 09:59:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 57AE4E0C8D; Tue, 22 Nov 2022 09:59:31 +0000 (UTC) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1930DE0C86 for ; Tue, 22 Nov 2022 09:59:30 +0000 (UTC) Received: by mail-qk1-x730.google.com with SMTP id d7so9860645qkk.3 for ; Tue, 22 Nov 2022 01:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=C3AbImI5CkVueY69hyEQADOP/oh6EzikPXbUAmdJEr8=; b=WYC5nhf36tJSbHrmJl/orQHQCzqZ3fPStAat8WRTRnNj/PpBW9Cv5t1ppHp+X0BMX/ S+aT2F/Iqm+KN32BMyMkbIBVWf1TdyqtnS2odBeET4unrW98rJxAirPolDUe+nnstJxU 4MAyN6E4pCFkjheJrEMJzTgUEyUd3I7z22O0vDkqEgShH2x9EIKqKiy43qm678zQZj9p li5WGl+jFCUlAPQEF3OFsAsyZ7LuUwQSZFaTdpqoCI/nl+g9PyUWHzuyu7Bl/wxWpfxi ogsawcn5srVQCJCFB8yLwmrwosLbI5pM2mbNPa4DKHG2WVQPTyzSbwptZua4YD+bXrma M54g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=C3AbImI5CkVueY69hyEQADOP/oh6EzikPXbUAmdJEr8=; b=rDxNQKRcVP1kQHfz+2xY5KVwdXR9LkGstyVNggC397mxKTAQA30n63ArJ3FSolYrTs Vw8TxXpiHyIC75S08+cb4a8Gzx3qQ6KTW1Ai3p7DRRza5nT/4dyYiH3Cs/K0+U/WElGR 5vDyvtwQw9vsxfm5EI6EgCCfJMBNAFnlA3As5WRcK2AhfdC0dqaUNniWALtfFFZ8nStM 8+e84Yv++9I8sQuAes8ACnllp7hCjTmmLO9MkESL2RV/B4qOZHg+HGzUinFso+XdZzA8 47VPuqgGeCJ0rkY27sg5VmU1t1yBsye0MJI/fD+ZGQAIIp9VMPpLWPLPNciAgTI5SwHx zeng== X-Gm-Message-State: ANoB5pku/EXIi6Nb5YfISA1SUO8Tpt9foWpEXizxU94CW//RCijNseiD QbOJXUFdypBDWa3/8sfsepM= X-Google-Smtp-Source: AA0mqf67Ebrp7NELTiBco2ih+XcTIPpflTDMvQrkgABSnrZRaJpWeFPUuvn2IasYtzMBt1zhNoPFWQ== X-Received: by 2002:a05:620a:852:b0:6fa:1e1a:8a8a with SMTP id u18-20020a05620a085200b006fa1e1a8a8amr20732448qku.657.1669111170272; Tue, 22 Nov 2022 01:59:30 -0800 (PST) Received: from [10.8.8.18] ([37.19.221.74]) by smtp.gmail.com with ESMTPSA id bs42-20020a05620a472a00b006b61b2cb1d2sm9794105qkb.46.2022.11.22.01.59.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Nov 2022 01:59:29 -0800 (PST) Subject: Re: [gentoo-user] Dolphin and adding a option, if it exists. To: gentoo-user@lists.gentoo.org References: <6ef36d93-4d8a-d9a4-ca71-396040103a25@gmail.com> <20221006134500.6f0812b9@digimed.co.uk> <62ebaa87-f750-b233-f8b4-ee50ef00bdfa@gmail.com> From: Dale Openpgp: preference=signencrypt Autocrypt: addr=rdalek1967@gmail.com; prefer-encrypt=mutual; keydata= mQINBGFSciYBEADcEGMyJBSuavKO/XKUVvgkxck7Nl8Iuu8N2lcnRji/rSKg5c1Acix1ll9i oW8JBCHwvn0+Xy60BvEsqcup3YSHw5STl/bR1ePEehtnYrg8FdjdS91+B805RfnKMm69rFVI wLSBHQrSG1yxHd8CloWoEdhmVtP24buajbh114bgXd9ahtpZrCVMrWdWYUg2mEXguGV5uNAh Rf8SWxDNc79w24JxsV34a8niMUYMjzWr0rafIbzk732X38vGjVMLo/2mMpkbp9mPp++LHoY+ 0Pet8zxxdXPJSCd475kza1AD+hhSyBZXB9yknYWgyY3cZe1rGmooJSi2KX4QxO7npwLThcO1 be6KKRkd35+Fi/a1BzVOHsZMiK/gcwxEFoMd27gir4ehaeHJfFXl+65w4hj0EsOZSxrJrm2C R50g5By2czSKP1bADEygFNpIJj51AR+wM88NImG2RPtlT2maYBzazvF05g65cdHXGp1C7W5P wwwKU2DgABB2t7N7z5A69LnryBRw4zUYDRRYLTYlBlYgg+xILm2c0OrBdxJgLJa7JE50Eo25 d3PFwt9J0gYvqy6sPFLl9So0sDg9zm0hKQtXOP5kgropUFGrNoJI+mjwF4rYLRBVzZwNAvlO OhEvHubBo3mEllv4x+FeptwXZxlk7gUsdqI8AxnFB8K9wi6FVQARAQABtBtEYWxlIDxyZGFs ZWsxOTY3QGdtYWlsLmNvbT6JAk4EEwEIADgCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AW IQQSG1h01ruv/WNXc3Q3RqOgiQH1GwUCYVJy8gAKCRA3RqOgiQH1G+waEACeTZCt77jnRAmQ AV7otKuZekDWiLi3Eig8tj5ZJiCNSYA/hIxzmexRP0GMqjitcXK1iGwWcvM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ux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.14 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: e3b11956-6257-42d3-a0cd-025e63f509a9 X-Archives-Hash: 8f51d28a69b2144233fa7f8d8f430768 Frank Steinmetzger wrote: > Am Sun, Oct 23, 2022 at 01:35:55AM -0500 schrieb Dale: > >> Well, I ran into a slight problem.  This isn't much of a problem with >> Linux but I'm not sure how this would work on windoze tho.  The problem, >> if it is one, is the file extension.  Let's say I have a mp4 file that >> is the older original file that I intend to replace.  If the file I >> intend to put in its place is a .mkv file, mv uses the .mp4 extension >> because all it cares about is the name of the file, not what it is or >> its content.  So, I end up with a .mkv file that has a .mp4 extension.  >> It works here on Linux but not sure about windoze and such. > It’s not a problem for as long as the application you open the file with > does its own detection. I.e. you feed mp4 to mpv, but it recognises by > itself that it’s mp4 and can handle it. > >> I looked at the man page and I don't see a way to tell it to retain the >> extension.  I see something about suffix but I don't think that is >> related to this.  If I just backspace and change the extension, it >> basically moves the file and I end up with both the old and new file.  I >> wish I could write code and create a tool for this.  :/  >> >> Is there a way to work around this problem?  It works great except for >> losing the file extension.  > 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.  It was leaving out the dot, ".", before the extension.  Back into the script I went.  I revved up my gears for a bit and made a edit.  When I tried it again, I was shocked.  I almost fell in the floor.  Dang thing worked perfectly with me only having to edit once.  I really did get how the script works, sort of.  O_O  This is the script as shown by cat: root@fireball / # cat /bin/dmv #!/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}" root@fireball / # I added a little . on that last line before the extension bit.  I'm a happy camper.  Only thing is, turns out both source and destination file have the same extension in this case.  Still, I bet it will work.  Then I thought of a way to test this.  I just changed the extension on the destination file and did a move.  I changed the .mp4 to .mkv on the destination.  When I used your move script, it used the .mp4 extension from the original source file but used the old name.  Perfect!! Hope this makes the point.  THANK YOU MUCH!!!! Dale :-)  :-)