LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ls\x20x for `ls x`: How to obfuscate required space token delimiter in bash shell, with hex/octal of space? (https://www.linuxquestions.org/questions/linux-newbie-8/ls%5Cx20x-for-%60ls-x%60-how-to-obfuscate-required-space-token-delimiter-in-bash-shell-with-hex-octal-of-space-4175616239/)

GentleThotSeaMonkey 10-23-2017 06:10 PM

ls\x20x for `ls x`: How to obfuscate required space token delimiter in bash shell, with hex/octal of space?
 
Is there any way to substitute the hex/octal value of a space, for a required space, in bash?

Like: ls\x20filename #NO space allowed, for my puzzle.
(echo something also not allowed, because of space!)

I tried web searches of title, and tried using backslashes, quotes and backtick.

Similarly, is there any way, with like just \x77, to enter the w (who) command? (no w and nothing with spaces)

Thanks Gurus ;)

Why? I just want to learn tricks. NO evil intents:D

Yes, I know echo x is similar, but no space allowed; echo\x20x fails.

allend 10-23-2017 06:24 PM

For \x to be interpreted, you need the -e option to echo.
echo -e "ls\x20filename"

[EDIT]I think I am misreading your question - Sorry[/EDIT]

GentleThotSeaMonkey 10-23-2017 06:37 PM

No problem on your space violation;)
You just rescued the ZRT list from exceeding 100, onto a 3rd page:D
LQ traffic is increasing :thumbsup:

allend 10-24-2017 06:14 AM

I have thought about this some more and I do not think it is possible. From 'man bash'
Quote:

DEFINITIONS
The following definitions are used throughout the rest of this document.
blank A space or tab.
word A sequence of characters considered as a single unit by the shell. Also known as a token.
and
Quote:

SHELL GRAMMAR
Simple Commands
A simple command is a sequence of optional variable assignments followed by blank-separated words and
redirections, and terminated by a control operator. The first word specifies the command to be exe-
cuted, and is passed as argument zero. The remaining words are passed as arguments to the invoked
command.
So anything other than a space or a tab will be interpreted as a token.


All times are GMT -5. The time now is 12:11 AM.