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
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
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
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.