-- LimingChen - 24-Jan-2011

How to see output (for example: make > make.out) in the output file.

ctrl+ z
bg
tail  -f *.out

Scp with password

##The 3 files used for copy with type in password. 
##In file !AutoScp:
#!/usr/bin/expect
spawn ~/bin/SingleScp [lindex $argv 0] [lindex $argv 1]
#The Scptime is 10hours
set timeout 360000s
expect "*@*pass*"
send "[lindex $argv 2]\r"
expect "*SingleScp*Success*"

##In file SCP:
#!/bin/bash
PassWord='******'
 echo Scp $1 To $2
~/bin/AutoScp  $1 $2 $PassWord
echo All Has Been Copied!

##In file !SingleScp:
#!/bin/bash
if scp -r -q -l 15000 $1 $2;then
echo $1 SingleScp Success
else
echo $1 SingleScp Not Success
fi

Compare event list

  • List format is
C4 189751 27251 1
C1 189751 66396 1
C1 189751 89702 1
C2 189751 89702 1
  • Bash job script
#!/bin/sh
#2012-06-14 Liming Chen

time=`date +%y%m%d%H%M%S`
echo "start at 20"$time

fHead=ee
fTail=.txt
file1=$fHead$fTail
file2="sf-"$fHead$fTail
fDiff=$fHead"Diff"$fTail
rm $fDiff

sed -i 's/ /_/g' $file1
sed -i 's/ /_/g' $file2
time=`date +%y%m%d%H%M%S`
echo "step 1: done the sed s/ /_/g on 20"$time

awk '{print $0}' $file1 $file2 |sort|uniq -u > $fDiff
time=`date +%y%m%d%H%M%S`
echo "step 2: done the awk diff on 20"$time

fTemp=$fHead"TempDiff"$fTail
fNew=$fHead"DetailDiff"$fTail
rm $fTemp $fNew
cp $fDiff $fTemp

for i in `cat $fTemp`
do

  line=""
  line=`cat $file1 | grep $i`
  #echo "1: line is " $line
  if [ "$line" != "" ]
  then
    echo "only mine have:" $line >> $fNew
    sed -i '/'$i'/d' $fTemp
  fi

  line=""
  line=`cat $file2 | grep $i`
  #echo "2: line is " $line
  if [ "$line" != "" ]
  then
    echo "only Bham have:" $line >> $fNew
    sed -i '/'$i'/d' $fTemp
  fi

done
time=`date +%y%m%d%H%M%S`
echo "step 3: Done on 20"$time
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2012-06-14 - LimingChen
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback