I have a script that I need to decifer...
#!/bin/csh
set the_mon_day = `date '+%m-%d'`
set date_fields=`date`
set dayofweek = $date_fields[1]
cd /aleph/u52_5/ccc50/print/
cp * /aleph/u52_5/alephe/ccc/print
set the_dir = `find . -name "save*" -type d | grep $the_mon_day`
cd $the_dir
mv -f c_b_001.let* "/aleph/u52_5/ccc50/print/z_c_b_001.$dayofweek"
mv -f c_i_002.let* "/aleph/u52_5/ccc50/print/z_c_i_002.$dayofweek"
mv -f c_r_001.let* "/aleph/u52_5/ccc50/print/z_c_r_001.$dayofweek"
mv -f c_r_105.let* "/aleph/u52_5/ccc50/print/z_c_r_105.$dayofweek"
mv -f s_b_001.let* "/aleph/u52_5/ccc50/print/z_s_b_001.$dayofweek"
mv -f s_r_001.let* "/aleph/u52_5/ccc50/print/z_s_r_001.$dayofweek"
mv -f s_r_105.let* "/aleph/u52_5/ccc50/print/z_s_r_105.$dayofweek"
mv -f t_b_001.let* "/aleph/u52_5/ccc50/print/z_t_b_001.$dayofweek"
mv -f t_r_001.let* "/aleph/u52_5/ccc50/print/z_t_r_001.$dayofweek"
mv -f t_r_105.let* "/aleph/u52_5/ccc50/print/z_t_r_105.$dayofweek"
cd /aleph/u52_5/ccc50/print/
mv -f c_a_001.rpt "/aleph/u52_5/ccc50/print/z_c_a_001.$dayofweek"
mv -f c_b_201.rpt "/aleph/u52_5/ccc50/print/z_c_b_201.$dayofweek"
mv -f c_r_201.rpt "/aleph/u52_5/ccc50/print/z_c_r_201.$dayofweek"
mv -f s_r_201.rpt "/aleph/u52_5/ccc50/print/z_s_r_201.$dayofweek"
mv -f t_r_201.rpt "/aleph/u52_5/ccc50/print/z_t_r_201.$dayofweek"
I need help with some of these lines:
I would like to know what
set the_mon_day = `date '+%m-%d'` does
and what
set the_dir = `find . -name "save*" -type d | grep $the_mon_day`
does.
i understand that a value is set to the_mon_day and then used in setting the_dir. But what does all the other bits like +%m-%d mean?
The script renames files to a new name with a new prefix and a new suffix (the day of the week).
Thanks in advance.
#!/bin/csh
set the_mon_day = `date '+%m-%d'`
set date_fields=`date`
set dayofweek = $date_fields[1]
cd /aleph/u52_5/ccc50/print/
cp * /aleph/u52_5/alephe/ccc/print
set the_dir = `find . -name "save*" -type d | grep $the_mon_day`
cd $the_dir
mv -f c_b_001.let* "/aleph/u52_5/ccc50/print/z_c_b_001.$dayofweek"
mv -f c_i_002.let* "/aleph/u52_5/ccc50/print/z_c_i_002.$dayofweek"
mv -f c_r_001.let* "/aleph/u52_5/ccc50/print/z_c_r_001.$dayofweek"
mv -f c_r_105.let* "/aleph/u52_5/ccc50/print/z_c_r_105.$dayofweek"
mv -f s_b_001.let* "/aleph/u52_5/ccc50/print/z_s_b_001.$dayofweek"
mv -f s_r_001.let* "/aleph/u52_5/ccc50/print/z_s_r_001.$dayofweek"
mv -f s_r_105.let* "/aleph/u52_5/ccc50/print/z_s_r_105.$dayofweek"
mv -f t_b_001.let* "/aleph/u52_5/ccc50/print/z_t_b_001.$dayofweek"
mv -f t_r_001.let* "/aleph/u52_5/ccc50/print/z_t_r_001.$dayofweek"
mv -f t_r_105.let* "/aleph/u52_5/ccc50/print/z_t_r_105.$dayofweek"
cd /aleph/u52_5/ccc50/print/
mv -f c_a_001.rpt "/aleph/u52_5/ccc50/print/z_c_a_001.$dayofweek"
mv -f c_b_201.rpt "/aleph/u52_5/ccc50/print/z_c_b_201.$dayofweek"
mv -f c_r_201.rpt "/aleph/u52_5/ccc50/print/z_c_r_201.$dayofweek"
mv -f s_r_201.rpt "/aleph/u52_5/ccc50/print/z_s_r_201.$dayofweek"
mv -f t_r_201.rpt "/aleph/u52_5/ccc50/print/z_t_r_201.$dayofweek"
I need help with some of these lines:
I would like to know what
set the_mon_day = `date '+%m-%d'` does
and what
set the_dir = `find . -name "save*" -type d | grep $the_mon_day`
does.
i understand that a value is set to the_mon_day and then used in setting the_dir. But what does all the other bits like +%m-%d mean?
The script renames files to a new name with a new prefix and a new suffix (the day of the week).
Thanks in advance.