I am using Linux and looking for the below scripts. Message script: the first sc
ID: 3698580 • Letter: I
Question
I am using Linux and looking for the below scripts.
Message script: the first script should display the IP address, machine name and path to the script. (This addition will help me to find your script when I look for it on your server.)
Pause script: the second script should pause for 30 seconds. By creating this script separate from the first, we can run it at boot up when a pause might be helpful (so the output from the script does not scroll by), but not when we start a terminal, when a pause would be an unnecessary delay.
WARNING:: DO NOT put an "exit" statement in your scripts. You will lock up your server.
Explanation / Answer
Script1:
#!/bin/bash
echo "Hostname "
hostname
echo " IP Address "
hostname -i
echo " Path to script "
DIR=`dirname $0`
echo $DIR
Script2:
#!/bin/bash
sleep 30
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.