#!/bin/bash

read -p "Are you sure you wish to execute \`$(pbpaste)\`? (Y/n) "    
[[ $REPLY =~ ^[Yy]?$  ]] && pbpaste | bash