How to stop zsh script from pausing (tty output)

I have a zsh script that I want to run so that it also downloads my .zshrc file. I believe that I need to run my script interactively?

So my script starts as follows:

#!/bin/zsh -i

if [ $# = 0 ]
then
    echo "need command line paramter..."
    exit
fi

However, when I try to run this script in the background, my script becomes paused (even if I pass the correct number of parameters):

[1]  + suspended (tty output) 

My question is: how can I make a script that can run in the background, which also loads my .zshrc boot file? If I need to put it online, how can I avoid pausing the tty exit problem?

thank

+5
1

!

zshrc script, :

#!/bin/zsh
source ~/.zshrc
...

disown bultin , - . :

$ disown %1

&! &:

$ ./my_command &!
+6

All Articles