Hi
I have 3 directories
indexes_with_ts
indexes_without_ts
process_indexes
in each directories it contains *.sql
how do I accomplish this:
for all the files found in indexes_without_ts, copy the corresponding file in indexes_with_ts to process_indexes.
i.e.
for indexes_without_ts/abc.sql
copy indexes_ts/abc.sql to process_indexes how do I achieve this?
code is in the current directory which contains all three directories.
my current code is
for file in indexes_without_ts/*.sql
do
cp -p "$file" process_indexes/"$file"
done
my current code gives me the following error.
cp: cannot create regular file `process_indexes/indexes_without_ts/uk_oe_term_march_cpg.sql': No such file or directory
cp: cannot create regular file `process_indexes/indexes_without_ts/uk_system_entity_code.sql': No such file or directory
cp: cannot create regular file `process_indexes/indexes_without_ts/uk_excel_network_networkno.sql': No such file or directory
thanks