cancel
Showing results for 
Search instead for 
Did you mean: 
Charles2321
Cadet
Cadet
  • 194 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
  • 125 Views

Re: Creating a child process for exucution (RHEL )

Jump to solution

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

Reply
Loading...
1 Reply
bbbk
Cadet
Cadet
  • 126 Views

Re: Creating a child process for exucution (RHEL )

Jump to solution

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

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