[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

syntax error


Hi, I have a bat file makeall.bat in linux
#!/bin/bash
for i in $(seq 1 23)
do
nohup bash runchr.bat ${i} >/dev/null 2&1 &
done

Open in new window

Can you look at it?
-bash-4.1$ bash makeall.bat
makeall.bat: line 4: 1: command not found
makeall.bat: line 4: 1: command not found
nohup: redirecting stderr to stdout

Open in new window

0
zhshqzyc
Asked:
zhshqzyc
  • 3
  • 2
1 Solution
 
AriMcCommented:
Can you also list the contents of runchr.bat ?
0
 
askurat1Commented:
Try something like this:
for i in $(seq 1 100); 
do 
echo -n "file${i} ";
touch file${i} 2>&1;
done

Open in new window

0
 
zhshqzycAuthor Commented:
runchr.bat, something like
#!/bin/bash
xyz --file path/chr$i \
           --out chr$i

Open in new window

xyz is an application progrom. -- means option, don't worry about it.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
AriMcCommented:
Should line 4 in makeall.bat be:

nohup bash runchr.bat ${i} >/dev/null 2>&1

?
0
 
AriMcCommented:
Oops, I mean:

nohup bash runchr.bat ${i} >/dev/null 2>&1 &

0
 
zhshqzycAuthor Commented:
Yes. You may be right.
The original post is at here
I want to utilize all cpus in the linux server.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now