1 |
Hi, |
2 |
|
3 |
I have a coyple of files on my harddisk and on a mobile usb-disc. |
4 |
|
5 |
Their names are of that pattern: |
6 |
|
7 |
something-<checksum>-something |
8 |
|
9 |
where 'soemthing' can be totally different from file to file and |
10 |
'<checksum>' is a checksum, which does not match the checksum of the |
11 |
according file. |
12 |
|
13 |
I want to delete the files on my harddisk, which has a '<checksum>' |
14 |
which matches the '<checksum>' of the according file on the mobile |
15 |
harddisk. |
16 |
|
17 |
The problem arises from a line of the shellscript I wrote. |
18 |
|
19 |
# code to extract the checksum from the file and put into |
20 |
# a variable named crc |
21 |
|
22 |
if [ -f <path to the mount point of the mobile disk>/*$crc* ] ; then |
23 |
|
24 |
# remove file on PC harddisk here |
25 |
|
26 |
fi |
27 |
|
28 |
As soon the file is not found, the script ends with an 'Not found' |
29 |
error, which '-f' is exactly for, because the expanding comes before |
30 |
the '-f'... |
31 |
|
32 |
So I need something else or a try-catch-thingy to make that work...but |
33 |
how? |
34 |
|
35 |
Or do I miss the forest for the trees here... ;) |
36 |
|
37 |
Thanks a lot for the forest in advance! |
38 |
Cheers |
39 |
Meino |