LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2017, 06:10 PM   #1
GentleThotSeaMonkey
Member
 
Registered: Dec 2016
Posts: 338
Blog Entries: 4

Rep: Reputation: 128Reputation: 128
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

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

Last edited by GentleThotSeaMonkey; 10-23-2017 at 06:15 PM.
 
Old 10-23-2017, 06:24 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
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]

Last edited by allend; 10-23-2017 at 06:30 PM.
 
Old 10-23-2017, 06:37 PM   #3
GentleThotSeaMonkey
Member
 
Registered: Dec 2016
Posts: 338

Original Poster
Blog Entries: 4

Rep: Reputation: 128Reputation: 128
No problem on your space violation
You just rescued the ZRT list from exceeding 100, onto a 3rd page
LQ traffic is increasing
 
Old 10-24-2017, 06:14 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What is the syntax to use octal number in xargs for delimiter argument? tprabhu1983 Linux - Newbie 7 05-14-2017 09:19 AM
bash shell script reading directory and file with space as argument pawimis Programming 5 04-15-2016 01:02 AM
[SOLVED] awk is replacing delimiter with a space theillien Programming 4 03-07-2013 08:30 AM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
Cedega "Disk space required for the installation exceeds available disk space" Solved Spewdemon LinuxQuestions.org Member Success Stories 1 10-18-2007 06:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration