I am trying to call a function using nohup like this:
nohup
function1(){ while true do echo \"function1\" sleep 1 done }
I find a working solution for me - define the function in a file (e.g. .functions) then run the function with nohup:
.functions
nohup bash -c "source .functions; function1" &
Tested on Ubuntu 13.04.