-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathReplaceAll.csh
More file actions
24 lines (23 loc) · 1.1 KB
/
ReplaceAll.csh
File metadata and controls
24 lines (23 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
set tdir = Programs
#set tdir = bin
set phome = `echo ${HOME} | sed s/'\/'/'\\\/'/g`
set flog = replace.log
rm -f $flog
#foreach file ( `find $tdir -type f \( -name "*\.c*" -o -name "*\.cpp*" -o -name "*\.C*" -o -name "*\.f*" -o -name "*\.csh*" \)` )
foreach file ( `find $tdir -type f` )
#foreach file (Script/FTAN/FTAN_SNR_ETHQ_fixed_bp.csh)
if( `grep '/home/tianye' $file | grep -v '/code' | grep -v '/Model' | grep -v '/MyLib' | grep -v '/home/tianye/for_' | grep -c -v '/Software' ` == 0 ) then
continue
endif
echo "Searching in "$file
set ftmp = $file'_replace_temp'
echo "#########################"$file"#########################" >> $flog
sed s/'\/home\/tianye\/Programs'/'\/home\/tianye\/code\/Programs'/g $file | sed s/'\/home\/tianye\/Script'/'\/home\/tianye\/code\/Script'/g | sed s/'\/home\/tianye\/sac'/'\/home\/tianye\/Software\/sac'/g | sed s/'\/home\/tianye\/code\/Programs\/pssac'/${phome}'\/usr\/bin'/g > $ftmp
#comm -23 $file $ftmp >> $flog
#echo "---------- to ----------" >> $flog
#comm -13 $file $ftmp >> $flog
sdiff -s -w 148 $file $ftmp >> $flog
echo "#\n#" >> $flog
#rm -f $ftmp
mv $ftmp $file
end