<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bash-completion Archives - Beshoy Girgis</title>
	<atom:link href="https://beshoy.girgis.us/tag/bash-completion/feed/" rel="self" type="application/rss+xml" />
	<link>https://beshoy.girgis.us/tag/bash-completion/</link>
	<description>Father, husband, son, nerd.</description>
	<lastBuildDate>Sun, 12 Mar 2017 08:05:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>My First Bash-Completion Script</title>
		<link>https://beshoy.girgis.us/2012/11/my-first-bash-completion-script/</link>
					<comments>https://beshoy.girgis.us/2012/11/my-first-bash-completion-script/#respond</comments>
		
		<dc:creator><![CDATA[Beshoy Girgis]]></dc:creator>
		<pubDate>Tue, 20 Nov 2012 01:27:45 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nerdy]]></category>
		<category><![CDATA[bash-completion]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://beshoy.girgis.us/?p=224</guid>

					<description><![CDATA[By golly, I&#8217;ve finally done it!  I love bash completion and must have it on any shell-based device I own.  I&#8217;ve written countless numbers of scripts but for the most part, they&#8217;re fairly self-contained &#8212; with the exception of the &#8220;perms&#8221; script.  This script is nice and quick on a one-site box where I can <a class="read-more" href="https://beshoy.girgis.us/2012/11/my-first-bash-completion-script/">[&#8230;]</a>]]></description>
										<content:encoded><![CDATA[<p>By golly, I&#8217;ve finally done it!  I love bash completion and must have it on any shell-based device I own.  I&#8217;ve written countless numbers of scripts but for the most part, they&#8217;re fairly self-contained &#8212; with the exception of the &#8220;perms&#8221; script.  This script is nice and quick on a one-site box where I can just run &#8220;perms&#8221; and my permissions for a set get reset to &#8220;production&#8221;.  I use this so that when doing WordPress updates for example, I can chmod -R 777 then run perms after all my updates &#8212; nice and quick! <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Servers running multiple sites require a more complex perms script which accepts a $1 variable of the domain.  From there, I run the specific chowns and chmods and what not for that particular site using a case as well as some defaults that affect all the sites.</p>
<p>I&#8217;ve found it annoying to have to type &#8220;perms beshoy.girgis.us&#8221; or &#8220;perms odslabs.com&#8221; so I made a quick script to take care of the domain part for me.  This script gets dropped in <span style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;">/etc/bash_completion.d/perms</span></p>
<pre class="brush: bash; gutter: true; first-line: 1"># bash completion for perms

_perms()
{
	  cur=${COMP_WORDS[COMP_CWORD]}
	  COMPREPLY=( $( compgen -W "$(ls /vhosts/)" -- $cur ) )
}
complete -o default -o nospace -F _perms perms</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://beshoy.girgis.us/2012/11/my-first-bash-completion-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 47/51 objects using disk
Page Caching using disk: enhanced 
Lazy Loading (feed)
Minified using disk
Database Caching using disk (Request-wide modification query)

Served from: beshoy.girgis.us @ 2026-08-13 17:22:56 by W3 Total Cache
-->