Q:

Magento CE 1.9 PATCH UPDATE 1533 5344

I am trying to install the security patches via SSH and I am getting the following errors:
www.mysite.com@www01:~$ sh ./html/PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh
./html/PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh: 24: 127: not found
./html/PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh: 24: 127: not found
./html/PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh: 29: cannot create 0: Permission denied
./html/PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh: 29: 0: not found
ERROR: "/www/sites/www.mysite.com/app/etc/" must exist for proper tool work. 

www.mysite.com@www01:~$ sh ./html/PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh
./html/PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 24: 127: not found
./html/PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 24: 127: not found
./html/PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 29: cannot create 0: Permission denied
./html/PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh: 29: 0: not found
ERROR: "/www/sites/www.mysite.com/app/etc/" must exist for proper tool work. 

Any ideas? 

A:

From the line in the error message:
ERROR: "/www/sites/www.mysite.com/app/etc/" must exist for proper tool work. 

I think that one of two things is happening either:

/www/sites/www.mysite.com is not your Magento root directory,
/www/sites/www.mysite.com/app/etc/ does not have the right permissions set,

Problem 1 is easily sortable, simply cd into the correct Magento root directory.  Problem 2 can be sorted by either applying the right permissions to the app/etc folder so that the script can create an applied patches xml file or make sure you are running the patch as the web user. 
To apply the patch as the webuser try:
sudo -u www-data sh ./html/PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh

Please change www-data to be your webuser. 

A:

Success!   i ran the following commands to execute with bash instead of sh, from the correct directory
www.mysite.com@www01:~$ cd /www/sites/www.mysite.com/files/html/
www.mysite.com@www01:~/files/html$ chmod +x PATCH*
www.mysite.com@www01:~/files/html$ ./PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully. 
www.mysite.com@www01:~/files/html$ ./PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.