linux wildcard usage in cp and mv
<p>I am composing a script to process 20 files. All of them located in different directories. I have partial file name. </p>

<ol>
<li>In log directory, File1_Date_time.err change to File1__Date_time_orig.err</li>
<li>cd ../scripts/ </li>
<li>sh File.sh </li>
</ol>

<p>File1 directory is /data/data1directory/Sample_File1/logs/File1_Data_time.err<Br>
File2 directory is /data/data2directory/Sample_File2/logs/File2_Data_time.err<Br>
.....</p>

<p>My script looks like this. (runrunrun.sh)</p>

<pre><code>#!/bin/bash
INPUT=$1
mv /data/*/Sample_*/logs/*_Data_time.err /data/*/Sample_*/logs/*_Data_time_orig.err
cp /data/*/Sample_*/scripts/*.sh /data/*/Sample_*/scripts/*_orig.sh
sh /data/*/Sample_*/scripts/*_orig.sh
</code></pre>

<p>When running it, I tried.<Br>
./runrunrun.sh File1 <Br>
. runrunrun.sh File1 <Br>
sh runrunrun.sh File1 <Br></p>

<p>mv: cannot move <code>/data/data1directory/Sample_File1/logs/File1_Data_time.err /data/*/Sample_*/logs/*_Data_time_orig.err</code>: No such file or directory
cp also got similar feedback</p>

<p>Am I doing it correct?</p>

<p>Thanks!</p>