Homework 6 - Cesar Perez
Shell Utilities:
I had some trouble getting ubuntu to work properly on my machine so I’ll be running all the linux commands on lectura, the linux machine that the Computer Science department allows it’s students to use.
echo
echo is used primarily in the terminal to print text back to the user:though for my CS classes echo plays a much more important role:
by typing in echo $? after running a program (in this case an earlier assignment for one of my CS classes), then the value printed out matches the return value for the program. In this case splitString.c returns 0 if it runs successfully with no errors, and returns a 1 if it encountered an error. This makes echo really important for testing out code.
rm
rm removes items from a directory, or in some cases it can remove an entire directory:It’s important to note in order to successfully remove a directory (in this case newDir) it needed to be empty
make
make is another command that I use a lot in my CS classes.make requires a Makefile in order to work, Makefiles are set up as follows
this allows us to execute the make command and run the indented command (gcc -Wall splitString.c -o splitString). Various files can be set up in a single make file, this makes it easier to ensure that all files that are dependent on each other are compiled at the same time with the most current code.
Package Install
So… I wanted to install the tldr package on ubuntu, but as mentioned above, I don’t really know how to fix the problems that I was getting:
It was really disappointing since tldr is a community driven project that makes new man pages for each shell command. The point of them is to get a more comprehensive (and less wordy) description of man pages with examples written that more portray what they due in a more simple manner.
But I did manage to find images of it working.