Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[solved] an undocumented linux command?!

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
razamatan
Apprentice
Apprentice
User avatar
Posts: 160
Joined: Fri Feb 28, 2003 8:51 am
Contact:
Contact razamatan
Website

[solved] an undocumented linux command?!

  • Quote

Post by razamatan » Fri May 01, 2009 1:34 am

so it seems that i stumbled upon a 'quote' command that's very similar to echo, but more retarded than it. i'm running bash-3.2_p39 ...

here's an example session:

Code: Select all

mustafa<301 ~>$ quote
''
mustafa<302 ~>$ which quote
which: no quote in (/home/jin/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/games/bin)
mustafa<303 ~>$ apropos quote
MIME::QuotedPrint    (3pm)  - Encoding and decoding of quoted-printable strings
PerlIO::via::QuotedPrint (3pm)  - PerlIO layer for quoted-printable strings
mustafa<304 ~>$ quote this is weird
'this'
mustafa<305 ~>$ quote "this is weird"
'this is weird'
mustafa<306 ~>$ quote 'this is weird'
'this is weird'
mustafa<307 ~>$ quote 'word up'
'word up'
mustafa<308 ~>$ quote tis' weird
>^C 
mustafa<308 ~>$ 
i did a man bash and looked for quote as a possible builtin, but no go. i also tried googling, but it's incredibly hard to disambiguate keywords that would be appropriate for it.

anyone care to educate?
Last edited by razamatan on Tue Apr 06, 2010 7:03 am, edited 1 time in total.
a razamatan doth speaketh,
"Never attribute to malice, that which can be adequately explained by stupidity"
Top
bunder
Bodhisattva
Bodhisattva
Posts: 5956
Joined: Sat Apr 10, 2004 5:13 am

  • Quote

Post by bunder » Fri May 01, 2009 1:48 am

1) sounds like you aliased quote to echo?
2) bash stuff goes in P+P. :?
Neddyseagoon wrote:The problem with leaving is that you can only do it once and it reduces your influence.
banned from #gentoo since sept 2017
Top
poly_poly-man
Advocate
Advocate
User avatar
Posts: 2477
Joined: Wed Dec 06, 2006 9:59 pm
Location: RIT, NY, US
Contact:
Contact poly_poly-man
Website

  • Quote

Post by poly_poly-man » Fri May 01, 2009 1:56 am

grep quote /etc/profile ~/.bash*
iVBORw0KGgoAAAANSUhEUgAAA

avatar: new version of logo - see [topic]838248[/topic]. Potentially still a WiP.
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Fri May 01, 2009 2:02 am

Not BASH. (Unless it's a plugin or something.)

It could be an alias.

Are you absolutely sure you're running BASH? Some other shells do have a 'quote' command that functions like 'echo'.
patrix_neo wrote:The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Top
justinkb
Apprentice
Apprentice
Posts: 161
Joined: Tue Dec 23, 2008 10:41 pm

  • Quote

Post by justinkb » Fri May 01, 2009 2:07 am

i have the same with bash-4 if i start a terminal... if i started bash from the same terminal and then try again, it gives me command not found. as does zsh.
Last edited by justinkb on Fri May 01, 2009 2:09 am, edited 1 time in total.
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Fri May 01, 2009 2:09 am

Does not work here in BASH-4, nor in BASH-3.

Code: Select all

~ $ quote
bash: quote: command not found
~ $ sudo quote
Password: 
sudo: quote: command not found
~ $ equery list bash
[ Searching for package 'bash' in all categories among: ]
 * installed packages
[I--] [ ~] app-shells/bash-4.0_p17-r1 (0)
Alias is the best explanation I can come up with.
patrix_neo wrote:The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Fri May 01, 2009 3:37 am

razamatan wrote:anyone care to educate?

Code: Select all

man 1p alias
bunder wrote:2) bash stuff goes in P+P. :?
Moved from Off the Wall to Portage & Programming.
Top
tgR10
Apprentice
Apprentice
Posts: 262
Joined: Tue Oct 23, 2007 9:36 pm
Location: caly ten ambaras
Contact:
Contact tgR10
Website

  • Quote

Post by tgR10 » Fri May 01, 2009 6:43 am

strange i got no alias for "quote" but same thing happen to me while im using it ..
never used "quote" before, never needed, just found out that thread so i decided to check

Code: Select all

~ [02:38:52] [pią maj 01] [$tgr@bitis-gabonica]  history: 1269
];-> quote ce
'ce'
 ~ [02:38:55] [pią maj 01] [$tgr@bitis-gabonica]  history: 1270
];-> echo $SHELL
/bin/bash
 ~ [02:38:59] [pią maj 01] [$tgr@bitis-gabonica]  history: 1271
];-> bash
 ~ [02:39:15] [pią maj 01] [$tgr@bitis-gabonica]  history: 1251
];-> quote ce
'ce'
 ~ [02:39:16] [pią maj 01] [$tgr@bitis-gabonica]  history: 1252
];-> grep quote /etc/profile  ~/.bash*
 ~ [02:39:42] [pią maj 01] [$tgr@bitis-gabonica]  history: 1253
];-> bash --version
GNU bash, version 4.0.17(2)-release (i686-pc-linux-gnu)
"bo kto ma racje ? ten kto z bliska zobaczy"
"moge nie wiedziec,wchlaniam niewiedze z malych torebek"
http://i12.tinypic.com/4pow0mu.png
http://userbar.tgr.debil.eu/userbar.jpg
Top
razamatan
Apprentice
Apprentice
User avatar
Posts: 160
Joined: Fri Feb 28, 2003 8:51 am
Contact:
Contact razamatan
Website

  • Quote

Post by razamatan » Fri May 01, 2009 7:28 am

hmm... it's not an alias... i grep'd for quote in /etc/profile* and ~/.bash* and returned nothing...

def not an alias or function...
a razamatan doth speaketh,
"Never attribute to malice, that which can be adequately explained by stupidity"
Top
livibetter
n00b
n00b
User avatar
Posts: 63
Joined: Sun Apr 19, 2009 7:21 am
Location: Taipei, Taiwan
Contact:
Contact livibetter
Website

  • Quote

Post by livibetter » Fri May 01, 2009 8:03 am

Run

Code: Select all

type quote
in bash to find out.

I don't have `quote`... wondering what it really is, too.
Top
justinkb
Apprentice
Apprentice
Posts: 161
Joined: Tue Dec 23, 2008 10:41 pm

  • Quote

Post by justinkb » Fri May 01, 2009 8:03 am

i grepped bash source code, didn't find any pointers there... except i figured out there is a 'dequote' too...

edit: FOUND IT...

Code: Select all

paul@yoga ~ $ grep dequote /usr/share/bash-completion/.pre
# This function shell-dequotes the argument
dequote()
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Fri May 01, 2009 5:47 pm

Give that man a stout!
patrix_neo wrote:The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Top
razamatan
Apprentice
Apprentice
User avatar
Posts: 160
Joined: Fri Feb 28, 2003 8:51 am
Contact:
Contact razamatan
Website

  • Quote

Post by razamatan » Tue Apr 06, 2010 7:03 am

truly... you'd think they'd namespace the functions...
a razamatan doth speaketh,
"Never attribute to malice, that which can be adequately explained by stupidity"
Top
stan666
Apprentice
Apprentice
User avatar
Posts: 165
Joined: Mon Jun 25, 2007 6:20 pm
Location: Germany
Contact:
Contact stan666
Website

  • Quote

Post by stan666 » Fri Apr 09, 2010 6:38 pm

Code: Select all

$ type quote
quote is a function.
quote () 
{ 
    echo \'${1//\'/\'\\\'\'}\'
}
But I have no idea where it is defined... :D
BOFH Excuse #450:
Terrorists crashed an airplane into the server room, have to remove /bin/laden. (rm -rf /bin/laden)
Top
XQYZ
Apprentice
Apprentice
User avatar
Posts: 231
Joined: Sun Jul 19, 2009 12:53 pm
Location: Europe
Contact:
Contact XQYZ
Website

  • Quote

Post by XQYZ » Fri Apr 09, 2010 6:48 pm

stan666 wrote:But I have no idea where it is defined... :D
I have the same output here on bash 4.1.5.

via the declare command I've found out that these functions are defined after /etc/profile executed, so I'm really nor sure where the hell they could come from.
Top
stan666
Apprentice
Apprentice
User avatar
Posts: 165
Joined: Mon Jun 25, 2007 6:20 pm
Location: Germany
Contact:
Contact stan666
Website

  • Quote

Post by stan666 » Fri Apr 09, 2010 7:22 pm

aha, here is that little bastard! :lol:

Code: Select all

$ grep quote /usr/share/bash-completion/.pre
# This function shell-quotes the argument
quote()
BOFH Excuse #450:
Terrorists crashed an airplane into the server room, have to remove /bin/laden. (rm -rf /bin/laden)
Top
Mike Hunt
Watchman
Watchman
User avatar
Posts: 5287
Joined: Sun Jul 19, 2009 11:01 pm

  • Quote

Post by Mike Hunt » Fri Apr 09, 2010 7:46 pm

Not sure.
On my unstable box it works, not on my stable box.

Both have quote() in /usr/share/bash-completion/.pre

And type quote returns the function on the unstable box, not on the stable one.

And neither box has quote aliased. So it can't be that.

Cool mystery, gotta dig deeper. :)
Top
Post Reply

17 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic