Appeler une fonction en utilisant nohup

Je suis en train d'appeler une fonction à l'aide de nohup comme ceci:

function1(){
    while true 
    do
        echo "function1"
        sleep 1
    done
}

nohup function1 & 
# ...... some other code

mais peut-être la fonction n'est pas vu par nohup et j'obtiens cette erreur:

nohup: failed to run command `function1' : No such file or dictionary

Je ne veux pas créer un nouveau fichier sh pour ma fonction. Comment puis-je résoudre ce problème?

source d'informationauteur sajad