1 |
marycruz |
1.1 |
#!/bin/sh -f
|
2 |
|
|
rm -f "creaCastorDir"
|
3 |
|
|
rm -f "creaCastorDir0"
|
4 |
|
|
exec grep -i user_remote_dir $@ | awk '
|
5 |
|
|
BEGIN { esc="^[[" }
|
6 |
|
|
{
|
7 |
|
|
thedirectory=""
|
8 |
|
|
init = substr($1,1,15)
|
9 |
|
|
if (init=="user_remote_dir")
|
10 |
|
|
{
|
11 |
|
|
for(i=0;i<length($1);i++)
|
12 |
|
|
{
|
13 |
|
|
sl = substr($1,15+i,1)
|
14 |
|
|
if(sl=="/")
|
15 |
|
|
{
|
16 |
|
|
##thedirectory= "/castor/cern.ch"substr($1,15+i)
|
17 |
|
|
##print "rfmkdir " thedirectory >> "creaCastorDir2"
|
18 |
|
|
##thedirectory= "/eos/cms/store/caf/user/"$theuser"/"substr($1,2+i)
|
19 |
|
|
thedirectory="/"substr($1,2+i)
|
20 |
|
|
print thedirectory >> "creaCastorDir0"
|
21 |
|
|
break
|
22 |
|
|
}
|
23 |
|
|
}
|
24 |
|
|
}
|
25 |
|
|
## if(length(thedirectory)>1)
|
26 |
|
|
## print "Creating directory: " thedirectory
|
27 |
|
|
}'
|
28 |
|
|
theuser=`whoami`
|
29 |
|
|
thenewdir=`cat creaCastorDir0`
|
30 |
|
|
echo "/afs/cern.ch/project/eos/installation/pro/bin/eos.select mkdir /eos/cms/store/caf/user/"$theuser$thenewdir >> "creaCastorDir"
|
31 |
|
|
echo "Creating directory: /eos/cms/store/caf/user/"$theuser$thenewdir
|
32 |
|
|
|
33 |
|
|
source creaCastorDir
|
34 |
|
|
|