I am trying to launch an .sh batch script

I have done this in the past with this:

spawn.sh launched by ./spawn.sh
=================================== this is the file ==========

!/bin/bash

for p in {50001..50019}
do
echo $p &
node Thunderbolt/serverTbolt $p &
done
for p in {51001..51009}
do
node Desperation/server $p &
echo $p
done
for p in {52001..52009}
do
node Hearts/server $p &
echo $p
done

exit 0

I created spawnMenu.sh with this

!/bin/bash

node Warrgames server2000 $p &
echo $p
node dmc2/server$p &
echo $p

exit 0

./spawnMenu.sh does not execute -- command not found

1 Reply

@swarr22 writes:

#!/bin/bash

node Warrgames server2000 $p &
echo $p
node dmc2/server$p &
echo $p

exit 0
 
./spawnMenu.sh does not execute -- command not found

Try using

  • /the/complete/absolute/path/to/node
  • /the/complete/absolute/path/to/Warrgames (could it be Wargames?)
  • /the/complete/absolute/path/to/dmc2/server

If none of that works, try putting

set -x

at the top of the script right after

#!/bin/bash

and

set +x

at the bottom of the script right before

exit 0

The shell will show you the execution of your script on your terminal and tell you which command can't be found.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct