![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calling function inside awk | jisha | Shell Programming and Scripting | 2 | 04-14-2008 08:44 AM |
| Calling other file function | maldini | Shell Programming and Scripting | 3 | 08-19-2005 03:23 AM |
| calling c++ function from script | Lebamb | High Level Programming | 3 | 06-24-2003 10:53 AM |
| c++ calling main() function | norsk hedensk | High Level Programming | 3 | 01-22-2003 08:28 PM |
| calling a c function from shell | seshagiri | UNIX for Dummies Questions & Answers | 4 | 12-06-2000 09:51 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Calling a function
I have created a file generic.func and it has lots of functions. One of the functions is this:
Code:
Check_backup_size()
{
dsmc q b $BACKUP_DIR/"*.Z" | awk '{print $1}'|sed 's/[^0-9]//g' > outputfile
X=`awk '{sum += $1} END {print sum }' outputfile'`
echo "$X"
ls -ltr $BACKUP_DIR/"*.Z" | awk '{print $1}'|sed 's/[^0-9]//g' > outputfile
S=`awk '{sum += $1} END {print sum }' outfile11'`
echo "$S"
if [ $X = $S ] ;
then
SUBJECT="Backup file size is same"
echo Backup file size is same > /apps/oracle/dsmc.txt
mailx -s "$SUBJECT" test@yahoo.com< /apps/oracle/dsmc.txt
else
echo"Please call the DBA's"
fi
}
. /apps/oracle/ashika/generic.func call check_backup_size BACKUP_DIR = /apps/oracle/ashika When i run Check_backup_size separately it gives the right result but when i call it as a function in test.sh it doesn't work.Please help.... Ashika Last edited by reborg; 09-12-2006 at 08:55 PM.. Reason: code tags |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|