What is the usage of the command
quote? I haven't found any info about it, it isn't among the executable files in
/bin folders, and it cannot be found among Bash built-ins. It seems that it only prints its first parameter, like an
echo command and nothing more.
What is it?
I noticed that this command does not work in my shell (fish, friendly interactive shell). It seems like it does only work in bash (Ubuntu's default).
What does it do? What can it be used for?
It adds the quotes but no newline. It also escapes single quotes in a way that's suitable for bash. It can be useful in scripts to quote a variable or some other kind of string. You need this for example for paths/parameters with spaces. Although there are other ways to do this.
It's really strange I could not find any documentation (in the web) about it. But well, it's easy to see what it does.
I would never use this function! If you need to quote stuff so as to be safely usable by a shell, please use
In fact, even this is very rarely used, there are always better strategies for high-level stuff as we, users, usually do. This
Edit. I've just checked on an Ubuntu 12.04 system, and the
How did I determine this? using a little of heuristic:
This function is defined somewhere in a bash initialization file. More precisely, if you are using Ubuntu 13.04, you can find it in
Use the following command to check it:
Its purpose is evidently clear.