I gang

creating bash

You are to make changes to the ssh.c source file to add the operators for redirection, '<', '>>', '>', '|', and the semi-colon, ';'. You only have to do this for two commands, for example:

$ cd ..;ls -l

total 42

drwxr-xr-x 6 someuser somegrp 4096 Oct 4 20:27 Archive

drwx------ 3 someuser somegrp 4096 Oct 4 11:31 Downloads

-rw-r--r-- 1 someuser somegrp 0 Oct 4 20:42 [url removed, login to view]

drwxr-xr-x 5 someuser somegrp 4096 Sep 25 08:30 games

drwxr-xr-x 2 someuser somegrp 32768 Oct 4 09:15 logs

drwxr-xr-x 8 someuser somegrp 4096 Oct 2 17:13 src

$ ls ; cd .. ; ls

sh: too many commands to process

$

Notice in the above examples the use of spaces. Around the operators, spaces don't matter, that is, you can have them there or not. Here are some more examples that you need to consider in writing a solution to this problem.

$ cat [url removed, login to view] > [url removed, login to view]

$ cat < [url removed, login to view]

$ cat [url removed, login to view] | grep George

George Scott

Buddy George

$

Assume redirection always follows the command as done above. This will make your processing a little easier, however, you must know that processing each command-line must be done in an order. Overall, the order for the shell is to:

Break up the line into one or two commands: process the ';' and '|'

Now you will need to keep track of the I/O requirements if you find '|'. The output of the first command goes to a pipe and the input of the second command comes from the pipe.

Process redirection for each command: process the '<', '>>', and '>'

You need to understand that the shell does not check for errors, such as, the second command receiving input from a pipe and also a redirection of input for the second command. Something like this:

$ cat [url removed, login to view] | grep xyz <[url removed, login to view]

In this case, the last processed I/O (the redirection) takes precedent and the pipe if forgotten! Even this does the last redirection without errors:

$ grep xyz <[url removed, login to view] <[url removed, login to view]

Test some of these variations on bash to verify the results. Make up some of your own to exhaust the combinations. It is surprising how many such errors are passed by in bash and other shells but this is the behavior of these programs. They do very little to determine if the command-line makes sense and just tries to perform the command as if nothing is wrong. HTML is processed in a very similar way. Errors are not recognized. Browsers will just try something without outputting any errors. The shell will print an error if it cannot understand some command, otherwise it just continues processing.

Once each of the above steps is processed, then you can process the command normally as we developed in class.

To summarize, the command line specification will be:

Commands are of the form: "command [options] [arguments]"

(Remember here spaces are significant.)

Redirection is allowed at the end of a command in the forms: "< file" or "> file" or ">> file"

(Spacing using redirection does not matter! Spaces can be absent or present.)

Two commands can be placed on a single command line using ';' and '|'. The two forms would look like:

"command-with-redirection ; command-with-redirection" or

"command-with-redirection | command-with-redirection"

(Again, spaces can be absent or present and it is interpreted the same.)

This means that redirection binds tighter to the commands than either ';' or '|'.

Remember to follow the examples above as a specification of your shell's behavior. I may not have listed all the problems that might occur for processing commands this way, although I have stated the general solution and behavior. So if you need more details, you should explore bash and discover the behavior using bash.

I've included some source code for ssh4.c and examples for creating processes with a pipe. Redirection is very similar except instead of creating a pipe, you should just open the files for I/O as specified in the redirection.

Færdigheder: Linux, UNIX

Se mere: a database error occurred error number 1064 you have an error in your sql syntax check the manual that corresponds to your mysql, creating pdf forms in word, creating a logo in word, creating a logo in photoshop, creating a logo in illustrator, starting business in nigeria process 2, starting business in nigeria process -- 2, learn web development php javascript html css in your spare time and earn money in the process hatfield, i need an editor for a book i am in the process of writing, compare arr grr rp and nn load balancing start with all the work w in one process, compare arr grr rp and nn load balancing start with all the work (w) in one process , creating bash script offers menu choices, bash script kill specific process, bash script kill httpd process, bash script restarts closed process

Om arbejdsgiveren:
( 0 bedømmelser ) United States

Projekt-ID: #15815564

Tildelt til:

lntrx

I can do it for you Relevant Skills and Experience Linux Stay tuned, I'm still working on this proposal.

$25 USD på 1 dag
(5 bedømmelser)
3.2

3 freelancers are bidding on average $25 for this job

nirmaljeetverma

My expertise and core knowledge in this field makes me the best suitable candidate for this job. I can assure you that you would love to hire me again once you are done with this job. Relevant Skills and Experience Li Mere

$25 USD på 1 dag
(14 bedømmelser)
3.7
$24 USD in 0 dage
(0 bedømmelser)
0.0