<?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: bash shell script: copy only files modifed after specified date</title>
	<atom:link href="http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/</link>
	<description>free software, free culture, free association</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:53:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: mani</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-4248</link>
		<dc:creator>mani</dc:creator>
		<pubDate>Thu, 29 Apr 2010 14:11:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-4248</guid>
		<description>i just tried it on my mac, and it did not work :(
this is what i got

---

./cpafter.sh -v -a 20100426 -s test-dir/ -t test-target
date: settimeofday (timezone): Operation not permitted
date: settimeofday (timezone): Operation not permitted
./cpafter.sh: line 91: (( - ) / 60 / 60 / 24) - 1: syntax error: operand expected (error token is &quot;) / 60 / 60 / 24) - 1&quot;)

copying from /Users/mani/Downloads/cpafter/test-dir
	to /Users/mani/Downloads/cpafter/test-target

find: -daystart: unknown option
find: -daystart: unknown option</description>
		<content:encoded><![CDATA[<p>i just tried it on my mac, and it did not work :(<br />
this is what i got</p>
<p>&#8212;</p>
<p>./cpafter.sh -v -a 20100426 -s test-dir/ -t test-target<br />
date: settimeofday (timezone): Operation not permitted<br />
date: settimeofday (timezone): Operation not permitted<br />
./cpafter.sh: line 91: (( &#8211; ) / 60 / 60 / 24) &#8211; 1: syntax error: operand expected (error token is &#8220;) / 60 / 60 / 24) &#8211; 1&#8243;)</p>
<p>copying from /Users/mani/Downloads/cpafter/test-dir<br />
	to /Users/mani/Downloads/cpafter/test-target</p>
<p>find: -daystart: unknown option<br />
find: -daystart: unknown option</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mani</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-4247</link>
		<dc:creator>mani</dc:creator>
		<pubDate>Thu, 29 Apr 2010 13:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-4247</guid>
		<description>can this also be used on a mac?
if so, has anybody used it and do i have to do anything different than listed above?

thank you!</description>
		<content:encoded><![CDATA[<p>can this also be used on a mac?<br />
if so, has anybody used it and do i have to do anything different than listed above?</p>
<p>thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Carpenter</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3935</link>
		<dc:creator>Scott Carpenter</dc:creator>
		<pubDate>Sat, 30 Jan 2010 00:41:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3935</guid>
		<description>Super!  Thanks for the feedback.</description>
		<content:encoded><![CDATA[<p>Super!  Thanks for the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: François</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3934</link>
		<dc:creator>François</dc:creator>
		<pubDate>Fri, 29 Jan 2010 21:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3934</guid>
		<description>Just a quick &quot;thanks for this&quot;. Worked as advertised and real useful!</description>
		<content:encoded><![CDATA[<p>Just a quick &#8220;thanks for this&#8221;. Worked as advertised and real useful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Stargard</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3697</link>
		<dc:creator>Mario Stargard</dc:creator>
		<pubDate>Mon, 10 Nov 2008 21:44:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3697</guid>
		<description>For MrM, the short answer is that you will need to include the script in your current environment like this:

&lt;code&gt;
. ./myscript
&lt;/code&gt;

The script doesn&#039;t have to be executable.

The reason you need to do this is because of the parent-child relationship in Unix processes.  The environment of the child can&#039;t be seen by the parent, so when you execute a script, you are creating a new process with a copy of the parent&#039;s environment.  When the child dies, the child&#039;s environment dies as well leaving you back to where you started.

Using an include, as shown above, you are simply saying to the shell, execute these commands as though you had typed them in your current environment.  The script, when included, doesn&#039;t need to be executable, doesn&#039;t need any shell magic declaration at the top, but does need to be written in the same shell language as the one you&#039;re in when calling it.

Cheers,
Mario</description>
		<content:encoded><![CDATA[<p>For MrM, the short answer is that you will need to include the script in your current environment like this:</p>
<p><code><br />
. ./myscript<br />
</code></p>
<p>The script doesn&#8217;t have to be executable.</p>
<p>The reason you need to do this is because of the parent-child relationship in Unix processes.  The environment of the child can&#8217;t be seen by the parent, so when you execute a script, you are creating a new process with a copy of the parent&#8217;s environment.  When the child dies, the child&#8217;s environment dies as well leaving you back to where you started.</p>
<p>Using an include, as shown above, you are simply saying to the shell, execute these commands as though you had typed them in your current environment.  The script, when included, doesn&#8217;t need to be executable, doesn&#8217;t need any shell magic declaration at the top, but does need to be written in the same shell language as the one you&#8217;re in when calling it.</p>
<p>Cheers,<br />
Mario</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Carpenter</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3679</link>
		<dc:creator>Scott Carpenter</dc:creator>
		<pubDate>Wed, 22 Oct 2008 09:30:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3679</guid>
		<description>Thanks for the feedback, timr -- I&#039;m glad you were able to work it out.</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback, timr &#8212; I&#8217;m glad you were able to work it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timr</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3678</link>
		<dc:creator>timr</dc:creator>
		<pubDate>Wed, 22 Oct 2008 03:17:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3678</guid>
		<description>Hi,
I used your copy_it.sh, but I ran into a slight problem, 

I&#039;m not sure that this would be a problem for others,
but I just figured I should give something back. 

The src file directory gets changed to the curdir,
but that didn&#039;t work for me. Here are the changes i made:
&lt;pre class=&quot;code&quot;&gt;
# copy_it.sh
# &#046;&#046;&#046;
curdir=$PWD		#from_dir

#regex &#045;&#045; does string start with dot slash?
&lt;b&gt;src_file=${from_file}&lt;/b&gt;
if [[ ! &quot;$from_file&quot; =~ ^&#092;&#046;/ ]]; then
	from_file=&quot;&#046;/$from_file&quot;  #in case only a filename was given
fi
# &#046;&#046;&#046;

#cp &#045;pdf &quot;$curdir/$from_file&quot; &quot;$to_dir/$from_file&quot;
&lt;b&gt;cp &#045;pdf &quot;$src_file&quot; &quot;$to_dir/$from_file&quot; &lt;/b&gt;
&lt;/pre&gt;

Thanks,
timr</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I used your copy_it.sh, but I ran into a slight problem, </p>
<p>I&#8217;m not sure that this would be a problem for others,<br />
but I just figured I should give something back. </p>
<p>The src file directory gets changed to the curdir,<br />
but that didn&#8217;t work for me. Here are the changes i made:</p>
<pre class="code">
# copy_it.sh
# &#0046;&#0046;&#0046;
curdir=$PWD		#from_dir

#regex &#0045;&#0045; does string start with dot slash?
<b>src_file=${from_file}</b>
if [[ ! &#0034;$from_file&#0034; =~ ^&#0092;&#0046;/ ]]; then
	from_file=&#0034;&#0046;/$from_file&#0034;  #in case only a filename was given
fi
# &#0046;&#0046;&#0046;

#cp &#0045;pdf &#0034;$curdir/$from_file&#0034; &#0034;$to_dir/$from_file&#0034;
<b>cp &#0045;pdf &#0034;$src_file&#0034; &#0034;$to_dir/$from_file&#0034; </b>
</pre>
<p>Thanks,<br />
timr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arunabha</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3645</link>
		<dc:creator>Arunabha</dc:creator>
		<pubDate>Wed, 27 Aug 2008 14:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3645</guid>
		<description>Hello,

can anybody help how and what script shall i make that can show me the updated/modified files in windows.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>can anybody help how and what script shall i make that can show me the updated/modified files in windows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Carpenter</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3606</link>
		<dc:creator>Scott Carpenter</dc:creator>
		<pubDate>Mon, 23 Jun 2008 02:17:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3606</guid>
		<description>Sorry, MrM, I don&#039;t know the answer to what I think you&#039;re asking.</description>
		<content:encoded><![CDATA[<p>Sorry, MrM, I don&#8217;t know the answer to what I think you&#8217;re asking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrM</title>
		<link>http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3604</link>
		<dc:creator>MrM</dc:creator>
		<pubDate>Sat, 21 Jun 2008 12:04:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.movingtofreedom.org/2007/04/15/bash-shell-script-copy-only-files-modifed-after-specified-date/#comment-3604</guid>
		<description>I&#039;m new to bash. I cd in a bash file and during the scripts its ok but after returning to command line prompt I&#039;m in the first Directory. How can I do scripts in the global environment?</description>
		<content:encoded><![CDATA[<p>I&#8217;m new to bash. I cd in a bash file and during the scripts its ok but after returning to command line prompt I&#8217;m in the first Directory. How can I do scripts in the global environment?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
