The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-24-2008
wrapster wrapster is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 193
cp script error, pls help in debugging!!!!

Hi all,

I searched to find out a few cp scripts that had progress bar, but did not compromise on performance, when my efforts were in vain i went ahead and wrote one of my own ,taking i/p frm other scripts...
But this is causing some errors and am unable to debug it.....pls help
Here is the code

#!/bin/bash

source=`stat -c %s $1`
dest=`stat -c %s $2`

while [ $source -ge $dest ];do
cp -f $1 $2 &
pct=$((( $dest * 100) / $source ))
dest=`expr $dest+1`
echo "$pct%"
done

bash3.2#./copy.sh <file1> <file2>

Error:
line 6:[0+1 interger expression expected ] ??
(Then i get the prompt), bash 3.2#No space left on the device

What does this mean???