No worries...
If you're defining the iRule from the bash command line on v9 or v10, you can use b or bigpipe. 'b' is a symbolic link to bigpipe:
file /usr/bin/b
/usr/bin/b: symbolic link to `bigpipe'
When using bigpipe, make sure to escape new lines in the iRule by wrapping the outer curly braces in single quotes like Nitass did.
b rule myapps.jeppesen.com-citrixtest '{
when HTTP_REQUEST {
if { [HTTP::header User-Agent] contains "CitrixReceiver" } then {
HTTP::redirect "https://myapps/PNAgent/config.xml"
} else {
HTTP::redirect "https://myapps/Citrix/XenApp"
}
}
}'
If you're adding the iRule in the GUI or iRule Editor, leave out "rule rule_name" and outer curly braces. The GUI and iRule Editor add this for you. Most of the examples on DC assume you're using the GUI or iRule Editor.
I've never used bpsh to create new objects, so I'm not sure why it wouldn't have worked with that. bpsh and bigpipe have been removed from the BIG-IP in v11. So I'd start focusing on using tmsh for command line tasks:
http://devcentral.f5.com/wiki/TMSH.HomePage.ashx
Aaron