Help: how to call fork() in shell script? New to linux

Hi, I'm writing a shell script where I want to call fork(). However I wrote like this "var=fork()" in c style and got this error:
"syntax error near unexpected token `(' "

How could I call fork() in shell script? Thanks in advance.

call like this..

fork() {
#do your things...
}

fork
1 Like

That's just a function declaration but doesn't create a new PID.
Maybe you would use subprocesses :

( # do your
     things
)

It would be easier for us if you explaned a bit more what you want to do.