Question

Write a linux bash script that enables user to create his resume make sure that the...

Write a linux bash script that enables user to create his resume make sure that the assigned value doesn't change.

Homework Answers

Answer #1

#!/bin/sh
trap trapInt INT

trapInt(){
echo 'Paused. Enter q to quit, something else to resume.'
read reply
[ "$reply" = "q" ] && exit
}

i=$$
while :; do
sleep 1
echo $$,$i
i=$((i+1))
done

The main block of the script is just a infinite loop, composed of a 1 second sleep, an echo of the PID of the shell ($$) and an incrementing number ($i).

Upon receiving the INT signal, the running command is interrupted and the function trapInt is executed.

$ ./v.sh
11136,11136
11136,11137
11136,11138
^CPaused. Enter q to quit, something else to resume.
  <-- typed <Enter>
11136,11139
11136,11140
11136,11141
^CPaused. Enter q to quit, something else to resume.
q <-- typed <q><Enter>
$ 
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
This is for my linux class. Write a script called activity4.2-3 that modifies your activity4.2-2 script...
This is for my linux class. Write a script called activity4.2-3 that modifies your activity4.2-2 script to also display a message when the user provided is not logged on. An example is shown below. Purpose: Determine if someone is logged on bash-3.2$ ./activity4.2-3 nonuser nonuser is either not logged on or not a valid user Include a first line that calls the bash shell as the interpreter Add a comment to state the purpose of the script and other comments...
Linux Write a script that takes a name as a parameter, then checks if the name...
Linux Write a script that takes a name as a parameter, then checks if the name is a file that exists in your homedirectory. Make sure to display the result.
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If...
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If no parameters passed, prompt a user (only one time) to enter numbers to sum and print the result.
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If...
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If no parameters passed, prompt a user (only one time) to enter numbers to sum and print the result.
How can I write a bash script that: Takes a series of filenames provided by the...
How can I write a bash script that: Takes a series of filenames provided by the user and moves them into their own new directory?
Linux 2)   Write a bash script which when executed, expects two integers, say n1 and n2....
Linux 2)   Write a bash script which when executed, expects two integers, say n1 and n2. If the first argument, n1, is greater than the second argument, n2, the script calls a function (written within the script) and passes to the function n1 and n2 to compute the sum from n1 to n2. This function returns the sum which the script prints. If n1 is not greater than n2, the script calls the same function and passes the n1 and...
5. Write a bash command that will display the name of every file on the Linux...
5. Write a bash command that will display the name of every file on the Linux system whose file contaent contains the string "doug.jones". The command must run in the background, must redirect standard error to /dev/null, and must redirect standard output to ~/out. 6. Write a bash command that will kill all of the even-numbered processes associated with your userid, and no other processes. 7. Write a bash command that will start the program /home/courses/140u-doug.jones/zombie_maker as a background process,...
Name the script for.sh.  This script will create a shopping list. Ask the user to enter items...
Name the script for.sh.  This script will create a shopping list. Ask the user to enter items separated by a space. Read the list. Use a for loop to write (use echo) the items to a file called shopping_list. You should use >> to append the output to the file, so each time the script is run the list should get longer. After the for loop finishes, display (use cat) the contents of the shopping list with 1 item per line....
In UNIX .Write a bash script that takes a list of usernames as its command line...
In UNIX .Write a bash script that takes a list of usernames as its command line arguments and displays on the screen, for each user name, a message of the form Number of times that logged into this machine is where is to be replaced by the number of recors that the last command output that match exactly. For example, if i enter command logincount mark it should output something like number of times that sweiss logged into this machin...
Write a script that plays a simple “guess the number” game with the user. It should...
Write a script that plays a simple “guess the number” game with the user. It should select a random integer in the range [0 - 10], ask the user to guess the value, and provide feedback of the form “too high”, “too low”, or “congratulations” as appropriate. After the correct value is guessed, the script should terminate.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT