Link to home
Start Free TrialLog in
Avatar of zhshqzyc
zhshqzyc

asked on

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

Avatar of AriMc
AriMc
Flag of Finland image

Can you also list the contents of runchr.bat ?
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

Avatar of zhshqzyc
zhshqzyc

ASKER

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.
Should line 4 in makeall.bat be:

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

?
ASKER CERTIFIED SOLUTION
Avatar of AriMc
AriMc
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes. You may be right.
The original post is at here
I want to utilize all cpus in the linux server.