3 ms·
No, & isn't the same as && which I think is what you're thinking. & is for backgrounding: #!/bin/sh date sleep 5 & # forks the command into the
by ketralnis 4y ago
No, & isn't the same as && which I think is what you're thinking.
& is for backgrounding:
#!/bin/sh
date
sleep 5 & # forks the command into the background, we proceed immediately
date
wait # pauses until the backgrounded sleep returns
date
has output
Fri Apr 14 13:17:00 PDT 2023
Fri Apr 14 13:17:00 PDT 2023
Fri Apr 14 13:17:05 PDT 2023