<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: 5 Useful Shell Scripts for Linux Newbies &#8211; Part II	</title>
	<atom:link href="https://www.tecmint.com/basic-shell-programming-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/basic-shell-programming-part-ii/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Thu, 01 Feb 2024 04:50:59 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Ravi Saive		</title>
		<link>https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-2131404</link>

		<dc:creator><![CDATA[Ravi Saive]]></dc:creator>
		<pubDate>Thu, 01 Feb 2024 04:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=3500#comment-2131404</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-2131297&quot;&gt;Pete&lt;/a&gt;.

@Pete,

I have modified a script and included a confirmation prompt, where the script will only proceed with deleting the original file if the user enters &lt;code&gt;&#039;y&#039;&lt;/code&gt; for yes. If &lt;code&gt;&#039;n&#039;&lt;/code&gt; or any other input is provided, the script will exit without removing the file. 

This helps prevent accidental deletions and provides a safer user experience.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-2131297">Pete</a>.</p>
<p>@Pete,</p>
<p>I have modified a script and included a confirmation prompt, where the script will only proceed with deleting the original file if the user enters <code>'y'</code> for yes. If <code>'n'</code> or any other input is provided, the script will exit without removing the file. </p>
<p>This helps prevent accidental deletions and provides a safer user experience.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Pete		</title>
		<link>https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-2131297</link>

		<dc:creator><![CDATA[Pete]]></dc:creator>
		<pubDate>Wed, 31 Jan 2024 18:23:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=3500#comment-2131297</guid>

					<description><![CDATA[I was bothered by one of these scripts (#3 gpg encryption), and strongly suggest at least checking the return code from gpg before removing any file, especially when teaching how to write scripts.  

I don&#039;t believe it is good practice to create scripts that remove files without pausing to ask permission first. The &lt;strong&gt;rm&lt;/strong&gt; command has a &lt;code&gt;-I&lt;/code&gt; option to prompt before deleting files which might be one possibility.  

A better option might be to decrypt each encrypted file and compare it to the original before removal.  I also suggest considering how unexpectedly the script as presented might operate when given file/directory names containing spaces.   

I appreciate what you all do here, and understand the intention was to keep it simple. It&#039;s great to teach scripting, but even better to teach defensive scripting.  Feel free to take it or leave it, but that&#039;s my two cents.]]></description>
			<content:encoded><![CDATA[<p>I was bothered by one of these scripts (#3 gpg encryption), and strongly suggest at least checking the return code from gpg before removing any file, especially when teaching how to write scripts.  </p>
<p>I don&#8217;t believe it is good practice to create scripts that remove files without pausing to ask permission first. The <strong>rm</strong> command has a <code>-I</code> option to prompt before deleting files which might be one possibility.  </p>
<p>A better option might be to decrypt each encrypted file and compare it to the original before removal.  I also suggest considering how unexpectedly the script as presented might operate when given file/directory names containing spaces.   </p>
<p>I appreciate what you all do here, and understand the intention was to keep it simple. It&#8217;s great to teach scripting, but even better to teach defensive scripting.  Feel free to take it or leave it, but that&#8217;s my two cents.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jhornel		</title>
		<link>https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-1323450</link>

		<dc:creator><![CDATA[Jhornel]]></dc:creator>
		<pubDate>Thu, 26 Mar 2020 02:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=3500#comment-1323450</guid>

					<description><![CDATA[This is my script. I am a beginner so I just used the old template. It was successful.
&lt;pre&gt;
#!/bin/bash
echo &quot;Welcome, now you want to decrypt a file/folder?&quot;
echo &quot;Currently I have a limitation. Place me to the same folder, where a file to be decrypted is present&quot;
echo &quot;Enter the Exact File Name with extension and the original filename before the encryption.&quot;
read file;
echo &quot;Enter the exact file name before the encryption.&quot;
read file2;
gpg -d $file &#062; $file2
echo &quot;I have decrypted the file successfully...&quot;
echo &quot;Now removing the original encrypted file...&quot;
rm -rf $file
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>This is my script. I am a beginner so I just used the old template. It was successful.</p>
<pre>
#!/bin/bash
echo "Welcome, now you want to decrypt a file/folder?"
echo "Currently I have a limitation. Place me to the same folder, where a file to be decrypted is present"
echo "Enter the Exact File Name with extension and the original filename before the encryption."
read file;
echo "Enter the exact file name before the encryption."
read file2;
gpg -d $file &gt; $file2
echo "I have decrypted the file successfully..."
echo "Now removing the original encrypted file..."
rm -rf $file
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hritik Maurya		</title>
		<link>https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-1219086</link>

		<dc:creator><![CDATA[Hritik Maurya]]></dc:creator>
		<pubDate>Tue, 06 Aug 2019 11:09:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=3500#comment-1219086</guid>

					<description><![CDATA[Please give the decryption code i had tried writing but not working..
]]></description>
			<content:encoded><![CDATA[<p>Please give the decryption code i had tried writing but not working..</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: mujibur rahiman		</title>
		<link>https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-1104522</link>

		<dc:creator><![CDATA[mujibur rahiman]]></dc:creator>
		<pubDate>Mon, 25 Feb 2019 04:33:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecmint.com/?p=3500#comment-1104522</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-944968&quot;&gt;qazi abid&lt;/a&gt;.

&lt;code&gt;gpg -d $file.gpg &#062; decpt.txt&lt;/code&gt; try this it will work.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/basic-shell-programming-part-ii/comment-page-1/#comment-944968">qazi abid</a>.</p>
<p><code>gpg -d $file.gpg &gt; decpt.txt</code> try this it will work.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
