1 |
battilan |
1.1 |
#!/bin/sh -f
|
2 |
|
|
rm -f "creaCastorDir"
|
3 |
|
|
exec grep -i user_remote_dir $@ | awk '
|
4 |
|
|
BEGIN { esc="^[[" }
|
5 |
|
|
{
|
6 |
|
|
thedirectory=""
|
7 |
|
|
init = substr($1,1,15)
|
8 |
|
|
if (init=="user_remote_dir")
|
9 |
|
|
{
|
10 |
|
|
for(i=0;i<length($1);i++)
|
11 |
|
|
{
|
12 |
|
|
sl = substr($1,15+i,1)
|
13 |
|
|
if(sl=="/")
|
14 |
|
|
{
|
15 |
|
|
thedirectory= "/castor/cern.ch"substr($1,15+i)
|
16 |
|
|
print "rfmkdir " thedirectory >> "creaCastorDir"
|
17 |
|
|
break
|
18 |
|
|
}
|
19 |
|
|
}
|
20 |
|
|
}
|
21 |
|
|
if(length(thedirectory)>1)
|
22 |
|
|
print "Creating directory: " thedirectory
|
23 |
|
|
}'
|
24 |
|
|
|
25 |
|
|
source creaCastorDir
|
26 |
|
|
|