Lab 8 Intro to unix
.docx
keyboard_arrow_up
School
Howard Community College *
*We aren’t endorsed by this school
Course
255
Subject
Computer Science
Date
Apr 29, 2024
Type
docx
Pages
1
Uploaded by BrigadierSardineMaster985 on coursehero.com
Define the following special bash environment (or keyword) variables
$0 : represents the name of the currently executing script which holds the name of the command used to invoke the shell
$1, $2, $3, etc. positional parameters passed to a shell script or function, $1 represents the first argument, $2 represents the second argument, etc.
$# variable that holds the total number of arguments passed to the script
or function
$? after executing a command the variable contains the exit status of the
last executed command, in which 0 typically indicated success
$* represent the arguments passed to the script
$$ variable that holds to PID of the currently running shell or script
$HOME represents the logged in users home directory path
$PATH shows a list of directories where shell looks for executable files.
$HISTSIZE specifies the max number of commands stored in the command history
$PS2 the secondary prompt displayed when the shell expects addition inputs on multi line commands
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Powershell Commands
Create two groups for two teams in your company (server development) and (software testing). There are 3 members in each team need to create. They are (Jaspreet, Lina and Hanh) for the server development team, and (Nina, David and Rahul) for the software testing team. Each member has to have some role description. Lina temporarily left so her account must be disabled. Rahul left the company to a new job. Lina came back to work so her account must be enabled again. The company decided to change the name of the server development to (software development).
arrow_forward
Bash Shell Scripting – Misc. Commands
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
arrow_forward
The mode portion of the command format is made up of the following parts:
Category of users you are working with: u = user, g = group, o = other or a = all
Permissions: r = read, w = write or x = execute
Assume the file, pfile1, has the following permissions, r----x-w-. Use symbolic mode to change the permissions to rwxrw-r--.
arrow_forward
True/False
store the appropriate boolean in the variable provided
for each of the following statements:
• function_names | basetball_game is a better function name than BasketballGame
• pwd | pwd is a shell command that prints your current working directory
cd | cd is a shell command that lists the files in your current working directory
• relative_paths | relative paths specify location relative to the computer's root directory
script | To execute a script my_script.py from a Jupyter Notebook in the same directory,
the cell would contain !python my_script. py
module | To import a module my_module.py from a Jupyter Notebook in the same directory,
the cell would contain import my_module.py
N # YOUR CODE HERE
I assert function_names is not None
I assert pwd is not None
I assert cd is not None
I assert relative_paths is not None
I assert script is not None
I assert module is not None
arrow_forward
Will be using code Lginter!
Registration
First Name
Last Name
Email Address
Password
Confirm Password
Require to have validation of user input
Valid email address
Make sure the email address does not exist in the database before doing insert into the database
Password and Confirm Password are matching
Password need to hash before doing insert into database ("password_hash" is a PHP build in function which can be used)
arrow_forward
Computer Science
[LINUX]
Create a single command that sets the shell variable GNUM to the group ID for your user id.
arrow_forward
In C language, please include notes as well explain each line
Each member the team will write the code for one of the following customized commands:
1. shell*: the environment that will execute the rest of the commands. the shell won’t terminate unless the exit command gets executed. The shell displays a different command prompt (i.e. something other than $ and >).
arrow_forward
Basic Shell Scripting
Create a script shell that processes the current time and displays 4 outputs as follows:
i. Displays the current time in the format HH:MM:SS.Example: Today is 12:30:01
ii. Displays per current time element from midnight.Example : 12 hours 30 minutes 01 seconds elapsed from last midnight
iii. Displays per current time element until midnight.Example : We will have 11 hours 29 minutes 59 seconds until next midnight
iv. Displays the numbers 1 to the difference of those hours on the same row separatedcharacter tilde (~) except the last number.
example picture:
**note: save as time.sh or copy paste the script on your answer
arrow_forward
Topic: External DSL's
Create a external DSL that describes drawing points, lines, and circles with varying lengths and colors in the scenario of an artist using a drawing application where editing and saving takes place. When the drawing is saved, the program will write out a text file that uses the DSL. When the drawing is edited, the program reads in, replays the DSL, and brings it back to where the artist left off.
arrow_forward
Creat a data file which stores all the email id's class students. Also read the all email id's of the student from the data file and display names on the screen..
arrow_forward
Select the correct command, term, or option.
This term describes a predesigned file with formatting and graphical elements on which you can base a file; using a template is a quick way to create a
Choose..
professional-looking file (document, presentation, spreadsheet, or database).
This term describes an interface element that contains a variety of options and commands that allow you to manage your files and perform tasks such as
Choose.
saving and printing.
Use this button to return to an open file from the backstage area.
Choose.
Click this tab to display the backstage area.
Choose..
The name of the open file displays on this area at the top of the workbook.
Choose.
Click this button to display the previous folder level.
Choose.
A OneDrive account or USB flash drive is an example of this, which is the place you save a file on the computer.
Choose.
This part of the file should be descriptive of the file contents so you can easily find the file you need.
Choose..
Click this option in…
arrow_forward
Marsha and Moira belong to the Sales group that has full control permissions to the K:\Sales folder. Within
this folder, Marsha is assigned read permission to a file named SalesPipeline. Moira is assigned read and
execute permissions to the same file. Marsha also belongs to the Marketing group that has read permissions
denied to the K:\Sales folder, while Moira also belongs to the Legal group that has write permissions denied
to the K:\Sales folder.
Which of the following is TRUE of the effective permissions in this scenario?
a) Marsha can modify the SalesPipeline file.
b) Moira can modify the SalesPipeline file.
C) Marsha cannot open the Sales folder.
a) Moira cannot open the Sales folder.
e) Neither can access the K:\ given this information.
f) Both CAN access every folder on the K:
arrow_forward
Computer Science
Bash Assignment: Write a script that:
Prompts the user for a directory name (Note that . means current directory)
Lists the executable files contained in the provided directory
arrow_forward
In PHP, $_SESSION is a predefined array that is used to:
1- Store the request data coming from web browser automatically.
2- Store data that can be used in the other pages until the user logs out from the website.
3- Store data temporarily until the fulfilment of the request.
4- Store data permanently in the Web Server.
arrow_forward
Objective: Please create a Java application supported by GUI Swing and File I/O.
Instructions:
1. Create an application that will enable the user to register an account through a registration form. Use the registration details (i.e., username and password) to log in to the registered account log-in form.2. The registration form should have simple constraints validation (i.e., fields should not be empty, password and confirm password did not match, etc.). If the input is not valid, the registration form should inform the user about the problem. If registration is successful, it should notify the user that Registration is Successful, and a button should be displayed for the log-in.3. The registered account should be stored in a text file and will be used in the log-in form.4. The log-in form should also have constraints validation (i.e., fields should not be empty, username and/or password did not match, etc.). If the input is not valid, the log-in form should inform the user about the…
arrow_forward
$script = $_GET["script"];eval("/$script;");Which of the following vulnerabilities could be exploited by an attacker examining the above code block?
A-) cross-site scriptingB-) Code injectionc_) File uploadD-)IDOR
arrow_forward
______ does not end a request.
response.write()
response.end()
response.render()
arrow_forward
PLEASE USE JAVA RMI AND JSON
Create an RMI application with GUI that will allow the recording of employee attendance. The program should run as follows:
The program has a JSON file that holds employee credentials.
Employees will enter their usernames and passwords to open the application.
Once they have successfully logged in to the application, they can click on the time in and time out button to record their time.
The JSON file will also hold the time in and out records.
arrow_forward
Objective: Please create a Java application supported by GUI Swing and File I/O.
Instructions:
1. Create an application that will enable the user to register an account through a registration form. Use the registration details (i.e. username and password) to log in to the registered account in the login form.2. The registration form should have simple constraints validation (i.e. fields should not be empty, password and confirm password did not match, etc.) If input is not valid, the registration form should inform the user about the problem. If registration is successful, it should notify the user that Registration is Successful and a button should be displayed for the login.
arrow_forward
Select all of the following Bash filename patterns that would only match the following filenames (i.e., no other files except these four could ever be matched by the chosen pattern(s)):
syscore5a.bin
syscore5b.bin
syscore9b.bin
syscore9a.bin
O syscore (5,9) {a,b).bin
O syscore{519} {a|b}.bin
O syscore [59] (a, b}.bin
O syscore [519] [alb].bin
O syscore [59ab].bin
O syscore [59] [ab].bin
O syscore [5, 9] [a,b].bin
O syscore (5,9}[ab].bin
arrow_forward
Use HTML , JAVASCRIPT AND CSS
WITH OUTPUT SEND
Create a Application that allows the user to customize the web page. Your design
must include CSS. The application should consists of three files as follows
a. Ask the user to login and read form the database to determine the
authentication. If the user is not known, the second file is loaded asking
the user to fill up the form to store personal data
b. Write a Java script to check the user is known user
c. Use cookies for storing the user details and display the user name when
the user moves on the next page.
arrow_forward
The contact form page must contain a form that contains the following fields: • Name • Email • The
message that the user wants to send When the form is submitted, all fields must be checked to
make sure they have been filled out. If the form validation is not successful, a bold red error
message should be displayed to the user on the page by manipulating the DOM. If the form
validation is successful, a bold green success message should be displayed to the user on the page by
manipulating the DOM. The message should say: "Dear Name, Thank you for your inquiry. One of
our team members will be in touch with you shortly" In the above message Name should be
replaced by the user's name from the form.
arrow_forward
20. Create a linux bash script to get a filename as input and then it should check and display if file exist and size
is greater than zero, then should get input of any file comparison operator and then display if the file is true
or false for that given file comparison operator.
21. Create a linux bash script to get three numbers as positional parameters then display the greatest and least
of the given numbers. If positional parameters are not given then message "This script requires 3 numbers
as positional parameters, Try again.." should be displayed.
arrow_forward
1) Write a bash script to demonstrate while loop which displays "While Loop Demo" and exits when key q is typed.
2) Write a bash script using while loop which displays date, your username and current directory every 15 seconds
scripts MUST be in bash shell linux commands
arrow_forward
WEB DEVELOPMENT IS THE SUBJECT
QUESTION -
Create a Application that allows the user to customize the web page. Your design
must include CSS. The application should consists of three files as follows
a. Ask the user to login and read form the database to determine the
authentication. If the user is not known, the second file is loaded asking
the user to fill up the form to store personal data
b. Write a Java script to check the user is known user
c. Use cookies for storing the user details and display the user name when
the user moves on the next page.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Related Questions
- Powershell Commands Create two groups for two teams in your company (server development) and (software testing). There are 3 members in each team need to create. They are (Jaspreet, Lina and Hanh) for the server development team, and (Nina, David and Rahul) for the software testing team. Each member has to have some role description. Lina temporarily left so her account must be disabled. Rahul left the company to a new job. Lina came back to work so her account must be enabled again. The company decided to change the name of the server development to (software development).arrow_forwardBash Shell Scripting – Misc. Commands 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 gccarrow_forwardThe mode portion of the command format is made up of the following parts: Category of users you are working with: u = user, g = group, o = other or a = all Permissions: r = read, w = write or x = execute Assume the file, pfile1, has the following permissions, r----x-w-. Use symbolic mode to change the permissions to rwxrw-r--.arrow_forward
- True/False store the appropriate boolean in the variable provided for each of the following statements: • function_names | basetball_game is a better function name than BasketballGame • pwd | pwd is a shell command that prints your current working directory cd | cd is a shell command that lists the files in your current working directory • relative_paths | relative paths specify location relative to the computer's root directory script | To execute a script my_script.py from a Jupyter Notebook in the same directory, the cell would contain !python my_script. py module | To import a module my_module.py from a Jupyter Notebook in the same directory, the cell would contain import my_module.py N # YOUR CODE HERE I assert function_names is not None I assert pwd is not None I assert cd is not None I assert relative_paths is not None I assert script is not None I assert module is not Nonearrow_forwardWill be using code Lginter! Registration First Name Last Name Email Address Password Confirm Password Require to have validation of user input Valid email address Make sure the email address does not exist in the database before doing insert into the database Password and Confirm Password are matching Password need to hash before doing insert into database ("password_hash" is a PHP build in function which can be used)arrow_forwardComputer Science [LINUX] Create a single command that sets the shell variable GNUM to the group ID for your user id.arrow_forward
- In C language, please include notes as well explain each line Each member the team will write the code for one of the following customized commands: 1. shell*: the environment that will execute the rest of the commands. the shell won’t terminate unless the exit command gets executed. The shell displays a different command prompt (i.e. something other than $ and >).arrow_forwardBasic Shell Scripting Create a script shell that processes the current time and displays 4 outputs as follows: i. Displays the current time in the format HH:MM:SS.Example: Today is 12:30:01 ii. Displays per current time element from midnight.Example : 12 hours 30 minutes 01 seconds elapsed from last midnight iii. Displays per current time element until midnight.Example : We will have 11 hours 29 minutes 59 seconds until next midnight iv. Displays the numbers 1 to the difference of those hours on the same row separatedcharacter tilde (~) except the last number. example picture: **note: save as time.sh or copy paste the script on your answerarrow_forwardTopic: External DSL's Create a external DSL that describes drawing points, lines, and circles with varying lengths and colors in the scenario of an artist using a drawing application where editing and saving takes place. When the drawing is saved, the program will write out a text file that uses the DSL. When the drawing is edited, the program reads in, replays the DSL, and brings it back to where the artist left off.arrow_forward
- Creat a data file which stores all the email id's class students. Also read the all email id's of the student from the data file and display names on the screen..arrow_forwardSelect the correct command, term, or option. This term describes a predesigned file with formatting and graphical elements on which you can base a file; using a template is a quick way to create a Choose.. professional-looking file (document, presentation, spreadsheet, or database). This term describes an interface element that contains a variety of options and commands that allow you to manage your files and perform tasks such as Choose. saving and printing. Use this button to return to an open file from the backstage area. Choose. Click this tab to display the backstage area. Choose.. The name of the open file displays on this area at the top of the workbook. Choose. Click this button to display the previous folder level. Choose. A OneDrive account or USB flash drive is an example of this, which is the place you save a file on the computer. Choose. This part of the file should be descriptive of the file contents so you can easily find the file you need. Choose.. Click this option in…arrow_forwardMarsha and Moira belong to the Sales group that has full control permissions to the K:\Sales folder. Within this folder, Marsha is assigned read permission to a file named SalesPipeline. Moira is assigned read and execute permissions to the same file. Marsha also belongs to the Marketing group that has read permissions denied to the K:\Sales folder, while Moira also belongs to the Legal group that has write permissions denied to the K:\Sales folder. Which of the following is TRUE of the effective permissions in this scenario? a) Marsha can modify the SalesPipeline file. b) Moira can modify the SalesPipeline file. C) Marsha cannot open the Sales folder. a) Moira cannot open the Sales folder. e) Neither can access the K:\ given this information. f) Both CAN access every folder on the K:arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTLINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE LNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning