echo Your system will be rebooted in 60 seconds as part of an IT maintenance action. Which of the following scripting files would contain the given command? A O bat B O js C O py D O sh
Added by Rocio L.
Close
Step 1
Step 1: The command "echo" is a shell command. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 60 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Create a script that can be run from the crontab or the command line to help you administer accounts. The script should allow for the creation, modification, and reporting of account status. The script should be able to do the following: - Report all users who do not have a password. If an account does not have a password, the program will automatically lock the account and report that it has been locked. - Report all expired accounts. - Report the expiration date/time for all accounts. - Report all accounts that do not expire. - Unlock or lock user accounts specified on the command line. - Add a user account to the system (interactive only, not run from the crontab). Specify the username, home directory, user's full name, password, and expiration date. You should be able to specify the usernames to be created on the command line or from a file specified on the command line. The script should either query for the detailed information or read it from the file. When adding an account, the user should have to reset their password upon first login into the system. - Change the expiration date for users specified on the command line. Do not allow the root account to have an expiration date. - The script should be able to write the results to a log file specified on the command line. You will need to run it as a privileged user.
Akash M.
Note: The question is related to Fedora Linux computer operating system. Option 2. Shell scripting Write bash shell scripts. (not allowed to write Python scripts or use any Python code, or use any other programming languages. Encourage creativity - They are free to use scripts with many lines of code, or try to solve problems as in one-liners script (First one is better practice, the latter one is more respected but error-prone). Direction: 1. Create a script using the name week14.sh (note: don't forget shebang and execute permission) and test it with an echo. Print "My Name - Your Name!" on the screen -- Replace 'Your Name' with your First and Last Name. 2. Modify the script from step 1 to include a variable. The variable will hold the contents of the message "My Name - Your Name!" on the screen -- Replace 'Your Name' with your First and Last Name. 3. Store the output of the command "hostname" in a variable. Display "This script is running on _." where "_" is the output of the "hostname" command. You will see your machine's hostname. 4. Display all NOVA campus names "AL", "AN", "LO", "MA", "Wo", and "MEC" on the screen, with each appearing on a separate line. Try not to allow any gap between the lines. 5. Add a function in this script that will display the number of files in the present working directory. Name this function "no_of_files" and call this function in your script. If you use a variable in your function, remember to make it a local variable (hint: use ls). 6. Modify the script from step 5 and make the "no_of_files" function accept a directory as an argument. Next, have the function display the name of the directory followed by a dash (-). Finally, display the number of files to the screen on the next line. Call the function at least three times. First on the "/usr" directory, next on the "/lib" directory, and finally on the "/etc" directory.
write the process to turn On and to turn off computer ?
Haricharan G.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD