The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
which one method is best for debugging the shell script? psiva_arul UNIX for Advanced & Expert Users 2 05-20-2008 06:33 AM
debugging a script?? wrapster Shell Programming and Scripting 2 03-25-2008 11:07 AM
Nee help debugging script..plz gzs553 Shell Programming and Scripting 8 11-24-2006 11:21 AM
FTP script debugging alfredo123 Shell Programming and Scripting 1 11-08-2006 01:22 PM
HP-UX Debugging Shell script shihabvk Shell Programming and Scripting 1 04-24-2006 09:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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???
  #2 (permalink)  
Old 05-24-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,291
There must be spaces around the plus sign in the expr statement:

Code:
dest=`expr $dest + 1`
Regards
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0