<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bash on Nalar</title>
    <link>https://nalar.dev/tags/bash/</link>
    <description>Recent content in Bash on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 26 Sep 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/bash/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Batch Convert JPEG and PNG to WebP with Bash and cwebp</title>
      <link>https://nalar.dev/batch-convert-jpeg-png-to-webp-with-bash/</link>
      <pubDate>Sat, 26 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/batch-convert-jpeg-png-to-webp-with-bash/</guid>
      <description>&lt;p&gt;Two files named &lt;code&gt;photo.jpg&lt;/code&gt; and &lt;code&gt;photo.png&lt;/code&gt; in the same directory would both become &lt;code&gt;photo.webp&lt;/code&gt;. A batch converter that notices the collision only after it starts encoding may leave one image unconverted or replace an earlier result. It is better to check the entire input list first.&lt;/p&gt;&#xA;&lt;p&gt;The Bash script here uses &lt;code&gt;cwebp&lt;/code&gt; for encoding and keeps a separate output tree. Its default &lt;code&gt;auto&lt;/code&gt; mode encodes JPEG with lossy WebP and PNG with lossless WebP. The source images stay in place; existing destination files are skipped.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Batch Resize Images with Bash and ImageMagick Without Overwriting Originals</title>
      <link>https://nalar.dev/batch-resize-images-with-bash-and-imagemagick/</link>
      <pubDate>Sat, 26 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/batch-resize-images-with-bash-and-imagemagick/</guid>
      <description>&lt;p&gt;A resize command is straightforward. Keeping a batch recoverable takes more care. Writing results over the source images can leave a collection only partly processed if a conversion fails. Flattening every result into one folder also creates collisions: &lt;code&gt;events/photo.jpg&lt;/code&gt; and &lt;code&gt;products/photo.jpg&lt;/code&gt; would have the same destination name.&lt;/p&gt;&#xA;&lt;p&gt;A separate output tree avoids both problems. The script below accepts a source directory, a destination directory, and a maximum edge length. It processes JPEG, PNG, and WebP files recursively, retains their relative paths and formats, and leaves the originals alone.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
