Home > Blockchain >  How to run application in background in shell script
How to run application in background in shell script

Time:03-17

I have a dotnet application and I want to publish it in the container. I have one requirement, when the application is started I have to push some data in my application. To do that I created a shell script and put it in the entry point command. Now I am running my application using a shell script.

The problem is when the application is started the script is not running the commands below it.

This is my shell script:

cd /app/WebAPI
dotnet WebAPI.dll
cd /app/data
for f in `ls *.txt`; do
  // some other command
done

I want to run this for loop after the application is started.

CodePudding user response:

Summarizing the comments above:

cd /app/WebAPI
dotnet WebAPI.dll &
cd /app/data
for f in *.txt; do
  # some other command
done
  • Related