LinuxQuestions.org
Visit Jeremy's Blog.
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 05-16-2012, 03:44 AM   #1
netbaby
LQ Newbie
 
Registered: Sep 2011
Posts: 11

Rep: Reputation: Disabled
Please explain these commands for me


Dear all,

I've a small question when I tried to check something in HP-UX:
Quote:
* 1st command:
$ echo '\'abc
bc

* 2nd command:
$ echo '\'xyzabc
\xyzabc

* 3rd command:
$ echo ''\'abc
'abc
Please find the result and explain me why we have those outputs?


Thank you very much :-)

Last edited by netbaby; 05-16-2012 at 03:46 AM.
 
Old 05-16-2012, 03:51 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
This is not linux related and is in the wrong forum, and also sounds like homework to me...

Googling for "escape character" and "quoting strings" + whatever shell you are using will answer that for you.
 
Old 05-16-2012, 09:42 AM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,309

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
this is what i get for question 1 on fedora linux:
Code:
[schneidz@hyper ~]$ echo '\'abc
\abc
not sure why hp-ux is different ?

Last edited by schneidz; 05-16-2012 at 09:44 AM.
 
Old 05-17-2012, 02:22 AM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
I am guessing this is the difference between the posix shell hp-ux will most likely be running, compared to the bash shell on fedora.

Im not particularly familiar with posix, so I cant be of any real help other than this link.
http://www.grymoire.com/Unix/Quote.html#uh-0
 
Old 05-18-2012, 07:29 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I get that output if I run them in tcsh. Is that the shell you're using?

The c-shell is notorious for it's poorly-designed parsing ability.
http://www.grymoire.com/Unix/CshTop10.txt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Explain commands to save md5sum of files in a folder into a text file tranduyhung Linux - General 4 09-14-2010 06:08 AM
what is the similarity between linux commands and dos commands kamalkirat1 Linux - Software 6 11-21-2008 08:54 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM
please explain these commands to me. Lleb_KCir Linux - General 16 04-02-2004 03:04 PM

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

All times are GMT -5. The time now is 09:02 AM.

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