Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

how do i write this in shell script, ubuntu linux For this exercise we will crea

ID: 3918311 • Letter: H

Question

how do i write this in shell script, ubuntu linux

For this exercise we will create a startup script. This script will start the VI editor. You can use any kind of patterns, but its always recommended to use case statement, when you’re testing on values of primitives. (ie. integers or characters).

You will call your script startapp and it will take one parameter.

The parameters should be start, stop and restart.

start: You must start VI as a background process so you can still have a shell

stop: You will need to use the kill command to kill the VI process

restart: First your script with kill the vi process, after that it will start a new instance of vi

Explanation / Answer

//@stop kill the process, $! gets the job id of backgorund process

$i=='stop'

kill KILL $!

// @restart first kill the job id then start the insatnce

$i=='restart'

kill $!

fg& vi