Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6059753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:44:50+00:00 2026-05-23T08:44:50+00:00

I have a zsh script that I want to run such that it also

  • 0

I have a zsh script that I want to run such that it also loads up my .zshrc file.
I believe I have to run my script in interactive mode?

Thus, my script begins like:

#!/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 suspended (even if I pass in the correct number of parameters):

[1]  + suspended (tty output) 

My question is: How can I make a script that can run in the background that also loads my startup .zshrc file? If I have to put it into interactive mode, how can I avoid the suspension on tty output problem?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:44:50+00:00Added an answer on May 23, 2026 at 8:44 am

    Don’t use interactive mode as a hash-bang!

    Instead, source your zshrc file in the script if you want it:

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

    For future reference, you can use the disown bultin to detach a previously backgrounded job from the shell so it can’t be suspended or anything else. The parent shell can then be closed with no affect on the process:

    $ disown %1
    

    You can do this directly from the command line when you start the program by using the &! operator instead of just &:

    $ ./my_command &!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that has a string in a file name like so:
I have the following in my .Zshrc . /Users/Masi/bin/Zsh/prompt I need run the following
The scenario is that users are asked to source a script file: $ source
I have a Bash tab-completion script for Apache's Hadoop. Normally, I use zsh as
I have some source code file which has mixed tabs/spaces and I want to
I have configured my emacs to run zsh shell within ansi-term. However, copy/paste no
I have not found a tab-completion script for RubyGem in Bash/Zsh. Where can you
I have the following system variable in .zshrc manuals='/usr/share/man/man<1-9>' I run unsuccessfully zgrep -c
Have an app that can use tts to read text messages. It can also
I have a Python script that is always called from a shell, which can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.