UPDATE: Redirections and commands with absolute path are not working as intended.
Execution with redirections
In the redirections you can find:
input redirection (>);
output redirection (<);
append (>>);
heredoc (<<);
The redirections are mainly following a simple syntax that the redirection is almost always followed by the file descriptor (fd). Therefore you will see < infile, > outfile, and >> outfile. The exception is heredoc, which is not creating a document per se, but it is writing directly to the STDIN.
USAGE:
%> echo test > infile
%> cat infile
test
%> rm outfile
rm: cannot remove 'outfile': No such file or directory
%> < infile cat | cat > outfile
%> cat outfile
test
%> echo test > infile
%> cat infile
test
%> echo test >> infile
%> cat infile
test
test
%> rm outfile
rm: cannot remove 'outfile': No such file or directory
%> << EOF cat | cat > outfile
> test
> EOF
%> cat outfile
test
Executing with absolute path:
The commands with absolute paths are as simple as it comes. If you give the path to the binary, the command line will fetch and execute your binary.
UPDATE: Redirections and commands with absolute path are not working as intended.
Execution with redirections
The redirections are mainly following a simple syntax that the redirection is almost always followed by the file descriptor (fd). Therefore you will see
< infile
,> outfile
, and>> outfile
. The exception is heredoc, which is not creating a document per se, but it is writing directly to theSTDIN
.USAGE:
Executing with absolute path:
The commands with absolute paths are as simple as it comes. If you give the path to the binary, the command line will fetch and execute your binary.
USAGE:
executing minishell in minishell
executing a binary that was copied
The list continues, but it is safe to assume that you can derive your own tests out of the two examples that were given.