Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Bash Shell Scripting – Misc. Commands
- Write a bash shell script with the following capabilities:
- Create a bash script ~/test3.sh with any text editor.
- Write a bash script that does the following:
- Declare a local variable to save your name.
- Declare another variable that stores your age.
- Echo both variables to the screen.
- Take a screenshot of the console output.
- Create a bash script ~/test4.sh with any text editor.
- Write a bash script that does the following:
- echo "File Name: $0"
- echo "First Parameter : $1"
- echo "Second Parameter : $2"
- echo "Quoted Values: $@"
- echo "Quoted Values: $*"
- echo "Total Number of Parameters : $#"
- Take a screenshot of the console output.
- Run your scripts after doing a chmod 777 on the script.
- Open a terminal window and run the following commands:
- which gcc
- man gcc
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- please comment all code Using a Bash environment, write a script to do the following: - declare and initialize an array to a few numbers.- in a loop, validate the numbers so they are greater than 0, if so:- get the total of them then the average.- print the average value.arrow_forwardWrite a shell script that allows the user to enter six numbers, and sends it to a file. After which, the script will then display it on the screen. Hint: Make sure the script "cleans up" before running again.arrow_forwardE7. Write a simple shell script to display number of files/directories in the current working directory. By using a text editor, write text as shown below and save it as "cmd1.sh": # files & direc tories script # displays # of files and directories echo "number of files & directories is:" && echo | ls -1 | WC -1 You can use bash command to execute script files. To run the cmd1.sh script, type $ bash cmd1. sh. There is also a way to change the script file mode and make it executable using the chmod command. Note that only the owner of a file can use change file mode. More information on chmod is available online or by using man.arrow_forward
- How to write code in git bash using shell script such that l want it to display multiples of and chosen number that are more than or equal to 15 upto less than or equal to 60( minimum and maximum range that a user chooses)arrow_forwardPlease answer the following Bash question, please show your output as well. 1. Write a Bash function named ‘Generate-ID' that generates all possible UGA student id start with 900. The output should be saved into a file named studentID.csv. 2. Write a Bash function named ‘Find_word’ that read wordlist.txt file to find all words end with “ing” and output these words to WordEndIng.csv. 3. The auth.log file (path: /var/log/auth.log) and syslog file (path: /var/log/syslog) are two of the most important log files in Linux. Generally, adversaries target these files so that system administrators couldn’t track what attackers are doing. Write a function named get-linuxlog() that reads all the above two files and stores them into a file named linuxeventlog.txt (Hint use the ‘cat’ command)arrow_forwardAre there any advantages to transitioning from the Bash shell to an alternative shell?arrow_forward
- aa lifecycle of android app. For XML file, you must use one text view to display message “I am XYZ” and in place of XYZ you must write your name. In the MainActivity.java file, override onCreate method to display Toast message “onCreate by XYZ” and in place of XYZ you must write your name. Similarly write all other methods like onStop, onStart, onPause, OnResume, OnRestart, onDestroy etc. The Following Screenshot shows a sample of how the app may looks like.arrow_forward9) Write a bash script using case statement that asks for input y or Y for YES and n or N for NO, then based on the inputthe script should display YES or NO accordingly. If other than y, Y, n or N entered it should display that only y, Y, n,N should be entered. scripts MUST be in bash shell linux commandsarrow_forwardYou are using the scripting statement case in a script and keep getting a message such as the following: script 1: line 10: syntax error: unexpected end of file what is the likely cause of the error? a) You didn't have a default condition set. b) You forgot to close the case with esac. c) You were using the old [ ] bash style insted of [[ ]]. d) You were comparing an integer when you should have been comparing a string.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education