Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
What is the quote command?

Using bash interactive terminal, the output of quote a is 'a' as expected. But quote doesn't work using bash -c 'quote a' or in a shell script, giving the error bash: line 1: quote: command not found. quote isn't an executable, and I failed to find quote in the bash builtins reference, so where does this command come from?

bashrc:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

stty -ixon

#source $HOME/.config/xdgrc
#source $HOME/.config/aliasrc

PS1='\[\033[38;2;50;255;50m\]\u\[\033[0m\]@\[\033[38;2;255;70;70m\]\h\[\033[0m\]:\w\[\033[38;2;50;255;50m\]\$\[\033[0m\]> '
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

quote is a helper function in /usr/share/bash-completion/bash_completion:

# This function shell-quotes the argument
quote()
{
    local quoted=${1//\'/\'\\\'\'}
    printf "'%s'" "$quoted"
}

I would not use it since it's only available in interactive shells when completion is enabled.

If you want to escape special characters in a script you can use ${var@Q} or printf %q instead.

$ wendys="Where's the beef?"
$ echo "${wendys@Q}"
'Where'\''s the beef?'
$ printf '%q\n' "$wendys"
Where\'s\ the\ beef\?
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda