From owner-freebsd-questions@freebsd.org Sun Jul 26 12:28:28 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B5AC3A6E96 for ; Sun, 26 Jul 2020 12:28:28 +0000 (UTC) (envelope-from kremels@kreme.com) Received: from mail.covisp.net (mail.covisp.net [65.121.55.42]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF2KR1hQdz4WZQ for ; Sun, 26 Jul 2020 12:28:26 +0000 (UTC) (envelope-from kremels@kreme.com) From: "@lbutlr" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: tbz file from pkg Date: Sun, 26 Jul 2020 06:28:25 -0600 References: <20200725203801.9a4965b8.freebsd@edvax.de> To: FreeBSD In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3649) X-Rspamd-Queue-Id: 4BF2KR1hQdz4WZQ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of kremels@kreme.com designates 65.121.55.42 as permitted sender) smtp.mailfrom=kremels@kreme.com X-Spamd-Result: default: False [-1.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.918]; FROM_HAS_DN(0.00)[]; MISSING_MIME_VERSION(2.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[kreme.com]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.993]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.87)[-0.868]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:209, ipnet:65.112.0.0/12, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[65.121.55.42:from] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 12:28:28 -0000 > On 25 Jul 2020, at 15:15, Lonnie Cumberland = wrote: >=20 > Hi All, >=20 > I find that I do not need a fully blown shell script, so I cobbled = together > a single set of shell commands that will convert "*.txz" file to = "*.tbz" > files and it seems to work. >=20 > # find *txz -iname '*txz' | while read txz; do echo "Found: $txz"; > name=3D$(echo "$txz" | sed -e 's/\.[^.]*$//'); mkdir -p tmp/$name; tar = -xjf > $txz -C tmp/$name; cd tmp/$name; tar cvfj ../../$name.tbz .; cd ../..; = rm > -Rf tmp/$name; rm -Rf tmp; done Hmm. I would not fully extract the tar file, but uncompress it and = recompress it. There is no need to explode the tar archive into = individual files. unxr file.txz bzip2 < file.tar > my_files.tbz Should manage the basic functionality.=20 for file in **/.txz; do unxr $file; bzip2< $(name%.tar}.tbz; done Or something like that (assuming your shell is bash, or I think this is = also valid in zsh). Not tested, but that's going to get you 95% of the = way there if it's not quite right. You can leave off the name substitution if you're ok with the result = being named file.tar.bz2 instead of file.tbz. --=20 Grow a pair of tits, Coldwater.