<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>nixCraft Linux / UNIX / Shell Scripting Forum - Shell scripting</title>
		<link>http://nixcraft.com/</link>
		<description>You can discuss the shell scripting, request shell scripts and scripting techniques</description>
		<language>en</language>
		<lastBuildDate>Thu, 23 May 2013 02:18:23 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://nixcraft.com/images/misc/rss.png</url>
			<title>nixCraft Linux / UNIX / Shell Scripting Forum - Shell scripting</title>
			<link>http://nixcraft.com/</link>
		</image>
		<item>
			<title>Syntax error near token unexpected token `</title>
			<link>http://nixcraft.com/shell-scripting/19728-syntax-error-near-token-unexpected-token.html</link>
			<pubDate>Tue, 21 May 2013 01:45:56 GMT</pubDate>
			<description>I am new to scripting and hardly use it and urgently need to finish some build script. The below script works perfectly fine on my mac 10.8.x, but...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->I am new to scripting and hardly use it and urgently need to finish some build script. The below script works perfectly fine on my mac 10.8.x, but throws an error when executed over any other mac 10.6.x/10.8.x. Please help me resolve this issue.<br />
<br />
Thanks.<br />
<br />
The script basically is to build projects using Xcode.<br />
<font color="#008400"><span style="font-family: Menlo"><br />
#! /bin/sh</span></font><br />
<font color="#D12F1B"><span style="font-family: Menlo"><font color="#000000">XCODEBUILD=</font>&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild&quot;</span></font><br />
<span style="font-family: Menlo"><br />
</span><br />
<font color="#008400"><span style="font-family: Menlo">#################################### SubRoutines ##################################################  ############</span></font><br />
<font color="#008400"><span style="font-family: Menlo"># Utility to print the messages</span></font><br />
<span style="font-family: Menlo"><br />
</span><br />
<span style="font-family: Menlo">PrintLog()</span><br />
<span style="font-family: Menlo">{ </span><br />
<span style="font-family: Menlo">    _Log=$<font color="#272ad8">1</font></span><br />
<font color="#008400"><span style="font-family: Menlo"><font color="#000000">   echo </font>###############</span></font><br />
<span style="font-family: Menlo">   echo <font color="#d12f1b">&quot;$_Log&quot;</font></span><br />
<font color="#008400"><span style="font-family: Menlo"><font color="#000000">   echo </font>###############</span></font><br />
<span style="font-family: Menlo">}</span><br />
<span style="font-family: Menlo"><br />
</span><br />
<font color="#008400"><span style="font-family: Menlo">##################################################  ##################</span></font><br />
<span style="font-family: Menlo"><br />
</span><br />
<font color="#D12F1B"><span style="font-family: Menlo"><font color="#000000">platformBaseDir=</font>`( cd ../.. ; pwd )`</span></font><br />
<span style="font-family: Menlo">cd $platformBaseDir</span><br />
<font color="#D12F1B"><span style="font-family: Menlo"><font color="#000000">PrintLog </font>&quot;platformBaseDir is : $platformBaseDir&quot;</span></font><br />
<br />
<br />
This throws an error - <br />
line 12: Syntax error near token unexpected token `<br />
line 12: `PrintLog.<br />
<br />
Why does it not throw any error in my 10.8.x, while it never works on any other 10.6.x/10.8.x?<br />
I have tried using _Log = &quot;$1&quot;, shebang is included too. I searched the web and this forum too and could not fix it. <br />
<br />
Please help.<br />
<br />
Thanks.<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>SindhuGururaj</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19728-syntax-error-near-token-unexpected-token.html</guid>
		</item>
		<item>
			<title>ls -l with additional info</title>
			<link>http://nixcraft.com/shell-scripting/19700-ls-l-additional-info.html</link>
			<pubDate>Wed, 15 May 2013 14:06:58 GMT</pubDate>
			<description>Hi. 
 
I want to execute ls -l command from script and then add some extra info (could be /var/test).  
 
Example: -rw-r--r-- 1 operus tdoper 2071143...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hi.<br />
<br />
I want to execute ls -l command from script and then add some extra info (could be /var/test). <br />
<br />
<span style="font-family: r_ansi"><font size="2"><span style="font-family: r_ansi"><font size="2">Example: -rw-r--r-- 1 operus tdoper 2071143 maj 14 10:19 abc.txt /var/test<br />
-rw-r--r-- 1 operus tdoper 2083145 maj 14 10:19 def.txt /var/test<br />
-rw-r--r-- 1 operus tdoper 2087645 maj 14 10:19 ghi.txt /var/test<br />
<br />
Any easy ways to do this? ;)<br />
<br />
MrDude<br />
</font></span></font></span><!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>MrDude</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19700-ls-l-additional-info.html</guid>
		</item>
		<item>
			<title>Linux command to show current directory via $PWD or pwd</title>
			<link>http://nixcraft.com/shell-scripting/19699-linux-command-show-current-directory-via-pwd-pwd.html</link>
			<pubDate>Tue, 14 May 2013 22:39:37 GMT</pubDate>
			<description>Hey, 
 
THis is forcing me to ask a basic and silly question - if both $PWD and pwd point to same location to show current dir on Linux. Which one is...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hey,<br />
<br />
THis is forcing me to ask a basic and silly question - if both $PWD and pwd point to same location to show current dir on Linux. Which one is recommended? Say<br />
<code style="background-color: rgb(222, 227, 231); padding: 0.2px; margin: 0.1em; display: inline-block;"><kbd>old=`pwd`</kbd></code><br />
OR<br />
<code style="background-color: rgb(222, 227, 231); padding: 0.2px; margin: 0.1em; display: inline-block;"><kbd>old=&quot;$PWD&quot;</kbd></code><br />
<br />
Are they same speed wise?<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>chinalinix</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19699-linux-command-show-current-directory-via-pwd-pwd.html</guid>
		</item>
		<item>
			<title>Execute a condition if and only if the previous one was successful</title>
			<link>http://nixcraft.com/shell-scripting/19698-execute-condition-if-only-if-previous-one-successful.html</link>
			<pubDate>Tue, 14 May 2013 17:35:14 GMT</pubDate>
			<description>hello 
 
i have a script with two conditions ( two different if conditions) : condition1 checks if a fileA exists and  
does unique sorting etc....</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->hello<br />
<br />
i have a script with two conditions ( two different if conditions) : condition1 checks if a fileA exists and <br />
does unique sorting etc. based on this condition-2 extracts a given column and copies to another file. <br />
<br />
is there a way to control the executuion of two conditions .. ie.start condiiton2 if condition1 has <br />
completed successfully else exit from the script.<br />
<br />
thanks<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>sbk785</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19698-execute-condition-if-only-if-previous-one-successful.html</guid>
		</item>
		<item>
			<title><![CDATA[[Solved] Awk to rearrange column value on Unix or Linux]]></title>
			<link>http://nixcraft.com/shell-scripting/19692-awk-rearrange-column-value-unix-linux.html</link>
			<pubDate>Tue, 14 May 2013 12:18:46 GMT</pubDate>
			<description><![CDATA[Hi, I have a couple of lines of text where I need to change the format of the date. 
 
AAN-WE-1212-GONE*,2012/02/11* 12:00:00,"0.00",ZZZ,AAN1112...]]></description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hi, I have a couple of lines of text where I need to change the format of the date.<br />
<br />
AAN-WE-1212-GONE<b>,2012/02/11</b> 12:00:00,&quot;0.00&quot;,ZZZ,AAN1112<br />
SOLD/2TDA/GONE42,<b>2011/01/11</b> 11:53:00,&quot;0.00&quot;,ZZZ,AAN1112<br />
<br />
The date format is in YYYY/MM/DD, I need it in DD/MM/YYYY<br />
<br />
so end result needs to look like this:<br />
AAN-WE-1212-GONE,<b>11/02/2012</b> 12:00:00,&quot;0.00&quot;,ZZZ,AAN1112<br />
SOLD/2TDA/GONE42,<b>11/01/2011</b> 11:50:00,&quot;0.00&quot;,ZZZ,AAN1112<br />
<br />
<br />
I've tried with awk with gsub and field seperators but I couldn't pull it off. <br />
<br />
Can anyone help with this?<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>ananth_ak</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19692-awk-rearrange-column-value-unix-linux.html</guid>
		</item>
		<item>
			<title>Unix / Linux: Searching in two files</title>
			<link>http://nixcraft.com/shell-scripting/19690-unix-linux-searching-two-files.html</link>
			<pubDate>Tue, 14 May 2013 02:11:10 GMT</pubDate>
			<description>hi  
 
can someone let me know as how to search for a word/s from file1 in file2 and display the matching lines found from file2. 
 
thanks</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->hi <br />
<br />
can someone let me know as how to search for a word/s from file1 in file2 and display the matching lines found from file2.<br />
<br />
thanks<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>sbk785</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19690-unix-linux-searching-two-files.html</guid>
		</item>
		<item>
			<title>in array values are not getting stored properly</title>
			<link>http://nixcraft.com/shell-scripting/19688-array-values-not-getting-stored-properly.html</link>
			<pubDate>Mon, 13 May 2013 06:38:52 GMT</pubDate>
			<description>hey,i stored the value of an sql query in an array and then tried to use that  
value in while loop. actually my array will have two or more values,...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start --><font color="#000000"><span style="font-family: verdana">hey,i stored the value of an sql query in an array and then tried to use that </span></font><br />
<font color="#000000"><span style="font-family: verdana">value in while loop. actually my array will have two or more values, then according to the values i have to display result.<br />
but it is not working<br />
<br />
</span></font><br />
<br />
<!-- BEGIN TEMPLATE: bbcode_code_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><br />
#!/bin/bash -xv<br />
<br />
<br />
val_1=$( sqlplus -s rte/rted1@rel75d1 &lt;&lt; EOF<br />
set heading off<br />
select max(istat_id) from cvt_istats;<br />
exit<br />
EOF<br />
)<br />
echo &quot;val_1: $val_1&quot;<br />
<br />
<br />
nohup ./cvt -f MediationSources.xml &amp;<br />
sleep 60<br />
<br />
<br />
declare -a arr<br />
arr=$( sqlplus -s rte/rted1@rel75d1 &lt;&lt; EOF<br />
set heading off<br />
select source_id from cvt_istats where istat_id &gt; $val_1;<br />
exit<br />
EOF<br />
)<br />
echo &quot;val_2: $arr&quot;<br />
<br />
<br />
i=0<br />
len=${#arr[@]}<br />
echo $len<br />
<br />
<br />
while [ $len -gt $i ]<br />
do<br />
&nbsp; if [ ${arr[$i]} == 1 ]<br />
&nbsp; then<br />
&nbsp; &nbsp; echo &quot;%D% FILE MASK PASS&quot;<br />
&nbsp; elif [ ${arr[$i]} == 2 ]<br />
&nbsp; then<br />
&nbsp; &nbsp; echo &quot;%C% FILE MASK PASS&quot;<br />
&nbsp; else<br />
&nbsp;  echo &quot;FILE MASK FAIL&quot;<br />
&nbsp; fi<br />
<br />
<br />
&nbsp; i=$(( $i + 1 ))<br />
done</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->Thanks<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>ramsavi</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19688-array-values-not-getting-stored-properly.html</guid>
		</item>
		<item>
			<title>Using shell loops in unix for comparing files</title>
			<link>http://nixcraft.com/shell-scripting/19687-using-shell-loops-unix-comparing-files.html</link>
			<pubDate>Sun, 12 May 2013 03:04:55 GMT</pubDate>
			<description><![CDATA[hi, 
 
can someone help me with a loop condition to compare two files (f1 & f2), f1 against f2.. display only the contents from f1 that do not match...]]></description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->hi,<br />
<br />
can someone help me with a loop condition to compare two files (f1 &amp; f2), f1 against f2.. display only the contents from f1 that do not match that of f2.<br />
<br />
thanks in advance<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>sbk785</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19687-using-shell-loops-unix-comparing-files.html</guid>
		</item>
		<item>
			<title>Sqlplus shell script to read values in variables</title>
			<link>http://nixcraft.com/shell-scripting/19684-sqlplus-shell-script-read-values-variables.html</link>
			<pubDate>Fri, 10 May 2013 06:13:28 GMT</pubDate>
			<description>hey , i am using this piece of code to connect to database and execute query and  then storing the result of that query in a value . after that i am...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->hey , i am using this piece of code to connect to database and execute query and  then storing the result of that query in a value . after that i am again using that value in <br />
other other select statement of mine but it is not working.<br />
<br />
<!-- BEGIN TEMPLATE: bbcode_code_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">#!/bin/bash -xv<br />
val_1=$( sqlplus -s rte/rted1@rel75d1 &lt;&lt; EOF<br />
setting heading off<br />
select max(istat_id) from cvt_istats;<br />
exit<br />
EOF<br />
)<br />
echo &quot;val_1: $val_1&quot;<br />
nohup ./cvt -f MediationSources.xml &amp;<br />
sleep 60<br />
val_2=$( sqlplus -s rte/rted1@rel75d1 &lt;&lt; EOF<br />
setting heading off<br />
select source_id from cvt_istats where istat_id &gt; $val_1;<br />
exit<br />
EOF<br />
)<br />
echo &quot;val_2: $val_2&quot;</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable --><br />
please help <br />
thanks<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>ramsavi</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19684-sqlplus-shell-script-read-values-variables.html</guid>
		</item>
		<item>
			<title>Projecteuler Problem 3#</title>
			<link>http://nixcraft.com/shell-scripting/19679-projecteuler-problem-3-a.html</link>
			<pubDate>Thu, 09 May 2013 09:09:10 GMT</pubDate>
			<description>I have solved projecteuler Problem, I just want feedback and code improvement..  
 
 
PHP: 
--------- 
#!/usr/bin/awk -f 
# The prime factors of...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->I have solved projecteuler Problem, I just want feedback and code improvement.. <br />
<br />
<!-- BEGIN TEMPLATE: bbcode_php_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#!/usr/bin/awk&nbsp;-f<br />#&nbsp;The&nbsp;prime&nbsp;factors&nbsp;of&nbsp;13195&nbsp;are&nbsp;5,&nbsp;7,&nbsp;13&nbsp;and&nbsp;29.<br />#&nbsp;What&nbsp;is&nbsp;the&nbsp;largest&nbsp;prime&nbsp;factor&nbsp;of&nbsp;the&nbsp;number&nbsp;600851475143&nbsp;?<br /><br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">get_PrimeFactor</span><span style="color: #007700">(</span><span style="color: #0000BB">n</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">x</span><span style="color: #007700">=</span><span style="color: #0000BB">2</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">#&nbsp;minimual&nbsp;prime<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">while&nbsp;(&nbsp;</span><span style="color: #0000BB">x</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">n&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;(</span><span style="color: #0000BB">n</span><span style="color: #007700">%</span><span style="color: #0000BB">x</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">n&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">n</span><span style="color: #007700">/</span><span style="color: #0000BB">x<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{&nbsp;</span><span style="color: #FF8000">#&nbsp;if&nbsp;n&nbsp;not&nbsp;devisable&nbsp;then&nbsp;increment&nbsp;x+1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">x</span><span style="color: #007700">++<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">n<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB">BEGIN&nbsp;</span><span style="color: #007700">{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">n&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ARGV</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">1</span><span style="color: #007700">&#93;&nbsp;</span><span style="color: #FF8000">#&nbsp;input&nbsp;number&nbsp;by&nbsp;user<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">print&nbsp;</span><span style="color: #0000BB">get_PrimeFactor</span><span style="color: #007700">(</span><span style="color: #0000BB">n</span><span style="color: #007700">)<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div>
<!-- END TEMPLATE: bbcode_php_printable --><!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>Rahul.Patil</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19679-projecteuler-problem-3-a.html</guid>
		</item>
		<item>
			<title>Remove comment script</title>
			<link>http://nixcraft.com/shell-scripting/19678-remove-comment-script.html</link>
			<pubDate>Thu, 09 May 2013 00:48:59 GMT</pubDate>
			<description><![CDATA[Hello All, 
 
I'm trying to write a shell script that removes the input (another program) comment and outputs the code only. I came with the command...]]></description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hello All,<br />
<br />
I'm trying to write a shell script that removes the input (another program) comment and outputs the code only. I came with the command line solution, but I don't know how to put it into a bash program.<br />
<br />
<br />
Here is the command line solution:<br />
<br />
sed -e '1{/^#!/ {p}}; /^[\t\ ]*#/d;/\.*#.*/ {/[\x22\x27].*#.*[\x22\x27]/ !{:regular_loop s/\(.*\)*[^\]#.*/\1/;t regular_loop}; /[\x22\x27].*#.*[\x22\x27]/ {:special_loop s/\([\x22\x27].*#.*[^\x22\x27]\)#.*/\1/;t special_loop}; /\\#/ {:second_special_loop s/\(.*\\#.*[^\]\)#.*/\1/;t second_special_loop}}' &quot;name of your program&quot;<br />
<br />
<br />
Please help.<br />
Thanks.<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>sam12</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19678-remove-comment-script.html</guid>
		</item>
		<item>
			<title>Sendmail with header and footer logo in HTML body</title>
			<link>http://nixcraft.com/shell-scripting/19676-sendmail-header-footer-logo-html-body.html</link>
			<pubDate>Tue, 07 May 2013 17:04:18 GMT</pubDate>
			<description>Hello, 
 
I need help with my script that will send email via sendmail  
command that will shows both the header and footer logo once the recepient ...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hello,<br />
<br />
I need help with my script that will send email via sendmail <br />
command that will shows both the header and footer logo once the recepient <br />
receive the email (e.g. MS Outlook). When I tested to ran the script it will <br />
successfully send the email BUT UNFORTUNATELY it doesn't displayed the logos as <br />
expected to its proper location. What shows was there's NO logo showed up in the Header location, and <br />
the logo showed up in the Footer location was the header logo <br />
image.<br />
<br />
Below are the scripts, thusly:<br />
<br />
*** In my sendTest.sh <br />
***<br />
<br />
<!-- BEGIN TEMPLATE: bbcode_code_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">#!/bin/bash<br />
DIR=/var/images<br />
export MAILTO=&quot;&quot;<br />
export SUBJECT=&quot;Test sendmail html format with logo both header and footer&quot;<br />
export BODY=&quot;/var/www/testcid.html&quot;<br />
export MAILPART=`uuidgen` # ***this will gen mailpart&nbsp; unique id<br />
export MAILPART_BODY=`uuidgen` # ***this will gen mailpart_body id<br />
export ATTACH=&quot;$DIR/headerLOGO.jpg&quot;<br />
export ATTACH1=&quot;$DIR/footerLOGO.jpg&quot;<br />
(<br />
echo &quot;To: $MAILTO&quot;<br />
echo &quot;Subject: $SUBJECT&quot;<br />
echo &quot;MIME-Version: 1.0&quot;<br />
echo &quot;Content-Type: multipart/mixed; boundary=\&quot;$MAILPART\&quot;&quot;<br />
echo &quot;&quot;<br />
echo &quot;--$MAILPART&quot;<br />
echo &quot;Content-Type: multipart/alternative; boundary=\&quot;$MAILPART_BODY\&quot;&quot;<br />
echo &quot;&quot;<br />
echo &quot;--$MAILPART_BODY&quot;<br />
echo &quot;Content-Type: text/plain; charset=ISO-8859-1&quot;<br />
echo &quot;You need to enable HTML option for email&quot;<br />
echo &quot;--$MAILPART_BODY&quot;<br />
# echo &quot;Content-Type: text/html; charset=ISO-8859-1&quot;<br />
echo &quot;Content-Type: text/html; charset=UTF-8&quot;<br />
echo &quot;Content-transfer-encoding: us-ascii&quot;<br />
echo &quot;Content-Disposition: inline&quot;<br />
cat $BODY<br />
# echo &quot;--$MAILPART_BODY--&quot;<br />
echo &quot;--$MAILPART&quot;<br />
echo 'Content-Type: image/jpeg; name=&quot;'$(basename $ATTACH)'&quot;'<br />
echo &quot;Content-Transfer-Encoding: uuencode&quot;<br />
echo 'Content-Disposition: attachment; filename=&quot;'$(basename $ATTACH)'&quot;'<br />
echo &quot;&quot;<br />
echo &quot;--$MAILPART&quot;<br />
echo 'Content-Type: image/jpeg; name=&quot;'$(basename $ATTACH1)'&quot;'<br />
echo &quot;Content-Transfer-Encoding: uuencode&quot;<br />
echo 'Content-Disposition: attachment; filename=&quot;'$(basename $ATTACH1)'&quot;'<br />
echo &quot;&quot;<br />
<br />
(uuencode $ATTACH $(basename $ATTACH) &amp;&amp; uuencode $ATTACH1 $(basename $ATTACH1))<br />
echo &quot;--$MAILPART--&quot;<br />
) &gt; catout.out<br />
cat catout.out | /usr/sbin/sendmail $MAILTO</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->*** In my testcid.html ***<br />
<br />
<!-- BEGIN TEMPLATE: bbcode_html_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<hr /><code class="bbcode_code"><span style="color:#000080">&lt;html&gt;</span><br />
<span style="color:#000080">&lt;head&gt;</span><br />
<span style="color:#000080">&lt;title&gt;</span>NOTIFICATION<span style="color:#000080">&lt;/title&gt;</span><br />
<span style="color:#000080">&lt;/head&gt;</span><br />
<span style="color:#000080">&lt;body&gt;</span><br />
<span style="color:#000080">&lt;center&gt;</span>&nbsp;  <span style="color:#800080">&lt;img border=1 src=<span style="color:#0000FF">&quot;cid:headerLOGO.jpg&quot;</span> alt=headerLogo /&gt;</span><br />
<span style="color:#000080">&lt;p&gt;</span><span style="color:#000080">&lt;h4&gt;</span>RE: xxxxx<span style="color:#000080">&lt;/h4&gt;</span><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; <span style="color:#000080">&lt;p&gt;</span>abcdefghijlsfdklslslsls<span style="color:#000080">&lt;br/&gt;</span><br />
&nbsp; &nbsp;  asdfewrsafsdfdsfs<span style="color:#000080">&lt;br/&gt;</span><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; <span style="color:#000080">&lt;p&gt;</span>Thank You.<span style="color:#000080">&lt;/p&gt;</span><span style="color:#008080">&lt;/td&gt;</span><br />
&nbsp; <span style="color:#000080">&lt;p&gt;</span>L<span style="color:#000080">&lt;/p&gt;</span><br />
<span style="color:#000080">&lt;center&gt;</span><span style="color:#800080">&lt;img src=<span style="color:#0000FF">&quot;cid:footerLOGO.jpg&quot;</span> alt=footerLogo/&gt;</span><span style="color:#000080">&lt;/center&gt;</span><br />
<span style="color:#000080">&lt;/center&gt;</span><br />
<span style="color:#000080">&lt;/body&gt;</span><br />
<span style="color:#000080">&lt;/html&gt;</span></code><hr />
</div>
<!-- END TEMPLATE: bbcode_html_printable -->Below are the actual email that I received when I ran the bash script as <br />
shown:<br />
<br />
<a href="http://nixcraft.com/attachments/shell-scripting/382d1367945642-sendmail-header-footer-logo-html-body-receivedemail.jpg"  title="Name:  receivedemail.jpg
Views: 5
Size:  30.6 KB">receivedemail.jpg</a><br />
<br />
<br />
Image below should supposedly showed up in the footer location -<br />
<br />
<a href="http://nixcraft.com/attachments/shell-scripting/383d1367945770-sendmail-header-footer-logo-html-body-footerlogo.jpg"  title="Name:  footerLogo.jpg
Views: 4
Size:  17.2 KB">footerLogo.jpg</a><br />
<br />
Do really appreciate your help for anyone could help me to investigate the scripts to make it work as expected.<br />
<br />
Thanks.<br />
<br />
Junix<!-- google_ad_section_end --></div>


	<div style="padding:10px">

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<ul>
			<!-- BEGIN TEMPLATE: postbit_attachment -->
<li>
	<img class="inlineimg" src="http://nixcraft.com/images/attach/jpg.gif" alt="File Type: jpg" />
	<a href="http://nixcraft.com/attachments/shell-scripting/381d1367945493-sendmail-header-footer-logo-html-body-received_email.jpg">received_email.jpg</a> 
(54.7 KB)
</li>
<!-- END TEMPLATE: postbit_attachment --><!-- BEGIN TEMPLATE: postbit_attachment -->
<li>
	<img class="inlineimg" src="http://nixcraft.com/images/attach/jpg.gif" alt="File Type: jpg" />
	<a href="http://nixcraft.com/attachments/shell-scripting/382d1367945642-sendmail-header-footer-logo-html-body-receivedemail.jpg">receivedemail.jpg</a> 
(30.6 KB)
</li>
<!-- END TEMPLATE: postbit_attachment --><!-- BEGIN TEMPLATE: postbit_attachment -->
<li>
	<img class="inlineimg" src="http://nixcraft.com/images/attach/jpg.gif" alt="File Type: jpg" />
	<a href="http://nixcraft.com/attachments/shell-scripting/383d1367945770-sendmail-header-footer-logo-html-body-footerlogo.jpg">footerLogo.jpg</a> 
(17.2 KB)
</li>
<!-- END TEMPLATE: postbit_attachment -->
			</ul>
			</fieldset>
	

	

	</div>

<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>junix88</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19676-sendmail-header-footer-logo-html-body.html</guid>
		</item>
		<item>
			<title>calculator</title>
			<link>http://nixcraft.com/shell-scripting/19671-calculator.html</link>
			<pubDate>Sat, 04 May 2013 02:06:41 GMT</pubDate>
			<description>Hi, 
 
I need to make sure my code is clean and in right format and acceptable by a coder. This is a simple calculator with all 4 operators. Did I do...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hi,<br />
<br />
I need to make sure my code is clean and in right format and acceptable by a coder. This is a simple calculator with all 4 operators. Did I do this right? Is there a better shorter way?<br />
I'm new to coding, Did I follow good coding format with spaces?<br />
<br />
Thanks.<br />
_____________________________<br />
<br />
#!/bin/bash<br />
timeout=1<br />
<br />
minus=&quot;1. Minus ( - )&quot;<br />
plus=&quot;2. Plus ( + )&quot;<br />
divide=&quot;3. Division ( / )&quot;<br />
multiply=&quot;4. Multipication ( * )&quot;<br />
quit=&quot;5. Quit&quot;<br />
<br />
<br />
function calc ()<br />
{<br />
clear<br />
while true; do<br />
read -p &quot;Val1: &quot; num1<br />
if [[ $num1 =~ ^-?[0-9]+$ ]]; then<br />
        break<br />
else<br />
        echo &quot;wrong&quot;<br />
        sleep $timeout<br />
        clear<br />
fi<br />
done<br />
<br />
while [[ $REPLY != 0 ]]; do<br />
clear<br />
echo &quot;Val1:&quot; $num1<br />
cat &lt;&lt;- _EOF_<br />
<br />
   Operator:<br />
<br />
     $minus<br />
     $plus<br />
     $divide<br />
     $multiply<br />
     $quit<br />
<br />
_EOF_<br />
read -p &quot;Enter Selection [1-5] &gt; &quot;<br />
echo<br />
<br />
if [[ $REPLY =~ ^[1-4]$ ]]; then<br />
        if [[ $REPLY == 1 ]]; then<br />
                op=-<br />
break<br />
        fi<br />
         if [[ $REPLY == 2 ]]; then<br />
 op=+<br />
break<br />
        fi<br />
         if [[ $REPLY == 3 ]]; then<br />
                op=/<br />
break<br />
        fi<br />
         if [[ $REPLY == 4 ]]; then<br />
                op=*<br />
break<br />
        fi<br />
<br />
        if [[ $REPLY == 5 ]]; then<br />
                echo &quot;Bye&quot;<br />
                sleep $timeout<br />
                echo &quot; &quot;<br />
exit 0<br />
        fi<br />
<br />
else<br />
<br />
        echo &quot;Not a valid selection&quot;<br />
        sleep $timeout<br />
fi<br />
done<br />
while true; do<br />
clear<br />
echo &quot;Val1: &quot;$num1<br />
cat &lt;&lt;- _EOF_<br />
<br />
   Operator:<br />
<br />
     $minus<br />
     $plus<br />
     $divide<br />
     $multiply<br />
     $quit<br />
<br />
_EOF_<br />
<br />
read -p &quot;Val2: &quot; num2<br />
if [[ $num2 =~ ^-?[0-9]+$ ]]; then<br />
        break<br />
else<br />
        echo &quot;wrong&quot;<br />
sleep $timeout<br />
        clear<br />
fi<br />
done<br />
<br />
<br />
total=$(($num1 $op $num2))<br />
clear<br />
echo &quot;Val1: &quot;$num1<br />
cat &lt;&lt;- _EOF_<br />
<br />
   Operator:<br />
<br />
     $minus<br />
     $plus<br />
     $divide<br />
     $multiply<br />
     $quit<br />
<br />
_EOF_<br />
<br />
echo &quot;Val2: &quot;$num2<br />
echo &quot; &quot;<br />
echo &quot;Your operation is -&gt;   $num1 $op $num2  =  $total&quot;<br />
echo<br />
sleep 20<br />
again<br />
}<br />
<br />
function again ()<br />
{<br />
while [[ $REPLY != 0 ]]; do<br />
clear<br />
echo<br />
echo &quot;Your operation is -&gt;   $num1 $op $num2  =  $total&quot;<br />
echo<br />
<br />
<br />
<br />
read -p &quot;Start Again? [y-n]: &quot;<br />
<br />
if [[ $REPLY == &quot;y&quot; ]]; then<br />
               calc<br />
break<br />
        fi<br />
 if [[ $REPLY == &quot;n&quot; ]]; then<br />
                echo &quot;Goodbye&quot;<br />
                sleep $timeout<br />
                echo &quot; &quot;<br />
exit 0<br />
<br />
else<br />
        echo &quot; &quot;<br />
        echo &quot;Not a valid selection&quot;<br />
        sleep $timeout<br />
fi<br />
done<br />
}<br />
<br />
calc<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>sam12</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19671-calculator.html</guid>
		</item>
		<item>
			<title>Bash Script add, delete users help!</title>
			<link>http://nixcraft.com/shell-scripting/19666-bash-script-add-delete-users-help.html</link>
			<pubDate>Wed, 01 May 2013 07:30:51 GMT</pubDate>
			<description>i am currently trying to create a script which presents any particular person with a menu when running this particular bash script. On the menu i...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start --><div style="text-align: left;"><font color="#000000"><span style="font-family: Arial">i am currently trying to create a script which presents any particular person with a menu when running this particular bash script. On the menu i have allowed three options (1. Add user, 2. Delete user and 3.Quit). In relation to the add user option once selected there should be 2 options which allow the user to manually input details for a new user or add multiple users via a text file. I have been able to create the menus/options described above although i have been unable to create the script/body of the tasks for the add user manually and many users via txt file aswell as delete user.</span></font><font color="#000000"><span style="font-family: Arial">Any advice or correcting to my code would be much appreciated thanks a lot<br />
<br />
Here is my script as of now :<br />
<br />
</span></font><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; #!/bin/bash</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable --></div><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; clear<br />
&nbsp; &nbsp; echo &quot;########## MENU ############\n&quot;<br />
&nbsp; &nbsp; options=(&quot;add_user&quot; &quot;delete_user&quot; &quot;exit&quot;)<br />
&nbsp; &nbsp; select opt in &quot;${options[@]}&quot;<br />
&nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; case $opt in<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;add_user&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clear<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while [ 1 ]<br />
&nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; clear<br />
&nbsp; &nbsp; &nbsp; echo &quot;1. Add user manually&quot;<br />
&nbsp; &nbsp; &nbsp; echo &quot;2. Add user via TXT file&quot;<br />
&nbsp; &nbsp; &nbsp; read -p &quot;Enter your choice&quot; ch<br />
&nbsp; &nbsp; &nbsp; case $ch in <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; read -p &quot;Enter user name : &quot; useradd<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  read -p &quot;Enter user password:&quot; passwd<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;Successfully added the user&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; 2)<br />
&nbsp; &nbsp; &nbsp;  if [ $(id -u) -eq 0 ]; then<br />
&nbsp; &nbsp; &nbsp; for row in `more $1`<br />
&nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; username=${row%:*}<br />
&nbsp; &nbsp; &nbsp; password=${row#*:}<br />
<br />
<br />
&nbsp; &nbsp;  egrep &quot;^$username&quot; /etc/passwd &gt;/dev/null<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp;  if [ $? -eq 0 ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;$username exists!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
&nbsp; &nbsp;  else<br />
&nbsp; &nbsp; &nbsp; &nbsp; pass=$(perl -e 'print crypt($ARGV[0], &quot;password&quot;)' $password)<br />
&nbsp; &nbsp; &nbsp; &nbsp; useradd -m -p $pass $username<br />
&nbsp; &nbsp; &nbsp; &nbsp; [ $? -eq 0 ] &amp;&amp; echo &quot;User has been added to system!&quot; || echo &quot;Failed to add a <br />
&nbsp; &nbsp; &nbsp; &nbsp; user!&quot;&nbsp; &nbsp; <br />
&nbsp; &nbsp; fi<br />
&nbsp; &nbsp; done<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Only root may add a user to the system&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 2<br />
&nbsp; &nbsp; fi&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; esac&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; done<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;delete_user&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; read -p &quot;Enter a User name to delete &quot;UNAME<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; passwd<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; userdel $UNAME<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;User $UNAME has been deleted&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;exit&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; esac<br />
&nbsp; &nbsp; &nbsp; &nbsp; done</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable --><div style="text-align: left;"><font color="#000000"><span style="font-family: Arial"><br />
</span></font></div><!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>vaguelines</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19666-bash-script-add-delete-users-help.html</guid>
		</item>
		<item>
			<title>Search and move with directory structure maintend.</title>
			<link>http://nixcraft.com/shell-scripting/19664-search-move-directory-structure-maintend.html</link>
			<pubDate>Tue, 30 Apr 2013 17:04:23 GMT</pubDate>
			<description>Hi Friends, 
 
 
I am looking for a simple bash command / script  which checks source location for 30 days old file and moves to  destination...</description>
			<content:encoded><![CDATA[<!-- BEGIN TEMPLATE: postbit_external -->
<div><!-- google_ad_section_start -->Hi Friends,<br />
<br />
<br />
I am looking for a simple bash command / script  which checks source location for 30 days old file and moves to  destination maintaining the same directory structure as source had. Its easy to find 30 days old file, but facing difficulty with maintained same directory structure as sources. Pls suggest.<br />
<br />
<br />
Regards,<br />
 Rahul Janghel.<!-- google_ad_section_end --></div>


<!-- END TEMPLATE: postbit_external -->]]></content:encoded>
			<category domain="http://nixcraft.com/shell-scripting/">Shell scripting</category>
			<dc:creator>rahuljanghel</dc:creator>
			<guid isPermaLink="true">http://nixcraft.com/shell-scripting/19664-search-move-directory-structure-maintend.html</guid>
		</item>
	</channel>
</rss>
