Question: I'm using Carbon Copy Cloner to backup some files and run a shell script after the backup process has completed. 

*Note: You can save a scheduled backup in Carbon Copy Cloner and set it to run a specific shell script after the backup.*

The shell script emailbackupstatus.sh looks like this and works fine:

```
#!/bin/sh

(sleep 10; /usr/libexec/PlistBuddy -c "Print" /Library/Logs/CCC.stats | tail -n 9 | mail -s "Backup completed" myname@mydomain.com) &

```

*Note: The plist file CCC.stats unfortunately does not contain the name of my saved backup schedule.*

But as I have several scheduled backups running every day, I get several identical emails every day. Therefore I would like to append a variable to the shell script, so that I can change the email subject to something like this:
"Backup of $backupName completed"

**Pass variable to shell script:**  

Is it possible to somehow pass a variable to my shell script, like you can do with the GET url variables in PHP? Something like this: `emailbackupstatus.sh&$backupName="Just testing"`

**Or even better:**  

Just get the name of my saved sheduled backup in Carbon Copy Cloner and append it to the email subject?

**The email I get looks like this:**  

 Dict {  

 targetDisk = root@backup.myserver.net:/Volumes/BACKUPDESTINATION/  

 date = Sun Dec 28 00:24:52 CET 2010  

 dataCopied = 0  

 elapsedTime = 1467.495361  

 sourceDisk = /Volumes/BACKUPSOURCE  

 exitStatus = 0  

 }  

}

Answer: 
I found that there is a bug in Oracle 11.2.0.1.0 which was causing this problem. 

```
alter session set optimizer_features_enable='11.1.0.7'

```

changing optimizer features solvesthis problem.
Unfortunately, I can't reproduce it.

As a workaround, try this:

```
SELECT  *
FROM    (
        SELECT  0 scrnfail_rate, '9' zz, 7 hh
        FROM    DUAL
        UNION ALL
        SELECT  0 scrnfail_rate, '9' zz, 7 hh
        FROM    DUAL
        )
WHERE   zz IS NOT NULL
        AND TO_CHAR (hh) NOT IN
        (
        SELECT  DECODE
                (
                scrnfail_rate, 0, -1,
                ROUND (LEVEL * 1 / (DECODE(scrnfail_rate, 0, 1, scrnfail_rate) / 100)) - ROUND (1 / (2 * (DECODE(scrnfail_rate, 0, 1, scrnfail_rate) / 100)))
                ) AS nno
        FROM    DUAL
        WHERE   NVL (scrnfail_rate, 0) > 0
        CONNECT BY
                LEVEL <= ROUND(9 * scrnfail_rate / 100)
        )

```