cancel
Showing results for 
Search instead for 
Did you mean: 
  • 1,135 Views

Creating a child process for exucution (RHEL )

Jump to solution

Complete beginner learing creating a script to but run and killed using the ps command 

this is the script my professer gave as an example

!#/bin/bash

while true : do

var=1

var [[ var -lt 50000]] : do

var=$((var+1))

done

sleep 1 

done

 

 

First of should you always type " while do "?

Also id like the understand why he used brackets instead of "()" 

Any help on creating my own process would be helpful as this is for a class 

 

 

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
bbbk
Cadet
Cadet
  • 1,067 Views

https://stackoverflow.com/questions/2188199/how-to-use-double-or-single-brackets-parentheses-curly-b...

for simple process (script) you can just write sleep xxx inside script :-)

in example:

sleep.sh:

#!/bin/bash
sleep 100


run it with

./sleep.sh &

will start your script/process in background and return shell PID you can kill

View solution in original post

1 Reply
bbbk
Cadet
Cadet
  • 1,068 Views

https://stackoverflow.com/questions/2188199/how-to-use-double-or-single-brackets-parentheses-curly-b...

for simple process (script) you can just write sleep xxx inside script :-)

in example:

sleep.sh:

#!/bin/bash
sleep 100


run it with

./sleep.sh &

will start your script/process in background and return shell PID you can kill

Join the discussion
You must log in to join this conversation.