{ 5 comments… read them below or add one }

1 Chris F.A. Johnson March 3, 2010 at 11:09 am

There is no good reason to use an external command (which) to find the location of a shell or any other executable file. Bash, like all Bourne-type shells, has the builtin command ‘type’.

If the command is a function or an alias, ‘which’ will not tell you that; ‘type’ will.

2 Chris F.A. Johnson March 3, 2010 at 11:14 am

Re: echo -e “Kernel Details: ” `uname -smr`

Command substitution is slow and, in this case, unnecessary.

Using ‘echo’ (which I don’t recommend) you could do:

echo -n “Kernel Details: ”
uname -smr

I rarely use echo because of portability problems; printf is universal:

printf “Kernel Details: ”
uname -smr

3 vasiauvi March 6, 2010 at 3:41 am

Thanks for this tutorial and wait the next one about bash scripting.

P.S. It would be nice if there where on your site option to save this kind of tutorials in pdf mode…I know there are addons for this but it’s an idea to implement directly in the site!

have a nice weekend!

4 Chris F.A. Johnson March 6, 2010 at 4:39 pm

man bash:

For almost every purpose, aliases are superseded by shell functions.

5 dfsdfsd March 7, 2010 at 6:38 am

Good post!

Leave a Comment

Previous post:

Next post: