LinuxQuestions.org
Register a domain and help support LQ
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, 04: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 04:46 AM.
 
Old 05-16-2012, 04:51 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
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, 10:42 AM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
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 10:44 AM.
 
Old 05-17-2012, 03:22 AM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
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, 08:29 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
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 07:08 AM
what is the similarity between linux commands and dos commands kamalkirat1 Linux - Software 6 11-21-2008 09:54 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 07:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 07:53 AM
please explain these commands to me. Lleb_KCir Linux - General 16 04-02-2004 04:04 PM


All times are GMT -5. The time now is 08:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration