Screenshot
---------------------------------------------------------------------
Program
%prompt string
inp='Enter file permissions:';
%for next line
inp=strcat(inp,char(13));
%Prompt
filePermission=input(inp,'s');
%Loop until end of the string
for i=1:i+4:length(filePermission)
%Each time new quadruple
quadruple='';
%get quadruple
for j=i:i+3
quadruple=strcat(quadruple,filePermission(j));
end
%Output string
output='';
%Loop through quadruplt
for n=2:length(quadruple)
%Switch for who using
switch n
case 2
output=strcat(output,'User:');
case 3
output=strcat(output,'
Group:');
case 4
output=strcat(output,'
Other:');
end
%Convert into int
val=str2num(quadruple(n));
%Swithch to get type of permission
switch val
case 0
output=strcat(output,'none');
case 1
output=strcat(output,'execute');
case 2
output=strcat(output,'write');
case 3
output=strcat(output,'write/execute');
case 4
output=strcat(output,'read');
case 5
output=strcat(output,'read/execute');
case 6
output=strcat(output,'read/write');
case 7
output=strcat(output,'read/write/execute');
end
end
%Display details
disp(output)
end
-----------------------------------------------------
Output
Enter file permissions:
071705020477017703610376075006750653051500200065
User:read/write/execute Group:execute
Other:read/write/execute
User:read/execute Group:none Other:write
User:read Group:read/write/execute Other:read/write/execute
User:execute Group:read/write/execute
Other:read/write/execute
User:write/execute Group:read/write Other:execute
User:write/execute Group:read/write/execute Other:read/write
User:read/write/execute Group:read/execute Other:none
User:read/write Group:read/write/execute Other:read/execute
User:read/write Group:read/execute Other:write/execute
User:read/execute Group:execute Other:read/execute
User:none Group:write Other:none
User:none Group:read/write Other:read/execute
Programming Assignment 5: For-Loops CSCI 251-Spring 2019 This program will use the concepts in th...
1. Write the command to set the following permissions on a script file with the following name; myscript.sh Owner: full access; read, write and execute Group: read and execute Other: no access 2. Create a new file with the name "myfirstscript.sh". Write a new script that performs the following tasks in sequence; Display the usernames of currently logged in users; sorted from a-z HINT: You will need to filter the output of the whocommand Display a list of usernames who...
Write a Java program to convert octal (integer) numbers into their decimal number equivalents (exactly the opposite of what you have done in Assignment 4). Make sure that you create a new Project and Java class file for this assignment. Your file should be named “Main.java”. You can read about octal-to-decimal number conversions on wikepedia Assignment 4 is at the bottom Objective Your program should prompt the user to enter a number of no greater than 8 digits. If the...
5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permissions testdir/testdir_1/file1 where owner has read and execute permissions testdir/testdir_1/file2 where where owner has read, write and execute permissions. Group has read only permissions 7. Create a directory called newdir/newdir_1/newdir_2 copy the file testdir/testdir_1/file1 to this directory Change the permisions of the file to owner,...
Please complete in JAVA only PROBLEM: CHMOD is a command in the UNIX computer system. It is the command used for giving users permissions to access and change files and directories. There are 3 classes of users. They are the owner, the group and others. The permissions given are: read(r, write(w) and execute(x). The argument of the CHMOD command is a 3-character octal number (ex. 526). When each digit of that number is converted to binary, the binary digits are...
Use PYTHON3 to create a program that asks the user for their name, and then prints their initials. You must create a function called getInitials() that takes the name string and prints out the initials. It must be case insensitive and the initials must be printed in upper case. The program must contain a main() and a function called getInitials(), implemented as described in the function header comment given below. (You should include this function header comment in your own...
Programming Assignment 3 CSCI 251, Fall 2015 Infinite Series Trigonometric and math functions are usually calculated on computers using truncated Taylor series (an infinite series). An infinite series is an infinite set of terms whose sum is a particular function or expression. For example, the infinite series used to evaluate the natural log of a number is (x - 1)2 (x-1)3 (x-1)* (x-1)5 2 4 where x E (0, 2], or 0
I have the following code....from the previous lab....the above needs to be added to what is already existing. ALSO MODIFY SEMAPHORES TO USE pthreads instead of the pipe constructs P() & V() #include <stdio.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include <sys/wait.h> #include <stdlib.h> #include <sys/stat.h> void printStat(char *filename); //Main int main(int argc, char *argv[]) { //Process Id (storing) pid_t pid; int j; //printf("Welcome to Project Three\n”); // For loop*/ for (j = 1; j...
Help writing MatLab code Lab Assignment 5-Employees Average Hours CSCI 251 Problem Statement Suppose the weekly hours for all employees are stored in a text file where each line contains the employee name followed by the hours worked for each day of the week. The data is stored as follows (data is continuous in the file but represented in columns below): Kelly Brian Katie Michae Emily Jim John Jane Joe Doe Smith Hart Jones Hu Wright Young Green Hurley Write...
Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using the cat command, create a file named classRoster with the following fields, separated by a comma. Student ID First Name Last Name Grade Program of Study ASURITE ID (username) Add three records to your file. Display the contents of the file. Move the file classRoster to the directory Activity1. Go to the Activity1 directory. Display the directory you are in. Add read, write and...
The purpose of this assignment is to create a program that works like a simple html file converter. Your program will read a text file and will produce an html file that can be viewed using a web browser, like Mozilla Firefox or Internet Explorer. Write code that converts an input file, myfile, into a simple Hyper Text Markup Language (HTML) file, myfile.html. In order to do this, you will read the input file, myfile, from the beginning to the...