0

I have a bash script that basically translates an argument to a kubectl command. For example: $ ./file.sh service1 (will run command kubectl logs service1- -n namespace -f) or $ ./file.sh service2 (will run command kubectl logs service2- -n anothernamespace -f)

My problem is that when I run it to see the logs live with option -f (follow) and I want to open another terminal tab to see the logs from another service with the same script, the first process is killed. So how can I run the same script from multiple terminals without stopping eachother and seeing the output for all.

1
  • 1
    It's unlikely that's this is an issue with running a single script in multiple terminals. I'd search for a clue somewhere else (logs, return codes ...). Commented Jan 30, 2023 at 9:09

1 Answer 1

1

Run the program in the background and output the log to out.file

command >> out.file 2>&1 &
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.