Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-20-2008, 08:29 PM
heavytull
 
Posts: n/a
diference between single slash and double

does anyone know the difference between running an application in the two
following ways?

#/sbin/'any_binary'
and
#/sbin//'any_binary'

?
Reply With Quote
  #2 (permalink)  
Old 07-20-2008, 08:59 PM
Chris F.A. Johnson
 
Posts: n/a
Re: diference between single slash and double

On 2008-07-20, heavytull wrote:
> does anyone know the difference between running an application in the two
> following ways?
>
> #/sbin/'any_binary'
> and
> #/sbin//'any_binary'


There is no difference; // is the same as /.

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
Reply With Quote
  #3 (permalink)  
Old 07-21-2008, 04:01 PM
heavytull
 
Posts: n/a
Re: diference between single slash and double

On Sun, 20 Jul 2008 20:59:47 +0000, Chris F.A. Johnson wrote:

> On 2008-07-20, heavytull wrote:
>> does anyone know the difference between running an application in the
>> two following ways?
>>
>> #/sbin/'any_binary'
>> and
>> #/sbin//'any_binary'

>
> There is no difference; // is the same as /.


is it same with | and ||?
Reply With Quote
  #4 (permalink)  
Old 07-21-2008, 11:17 PM
Unruh
 
Posts: n/a
Re: diference between single slash and double

heavytull <heavytull@hotmail.com> writes:

>On Sun, 20 Jul 2008 20:59:47 +0000, Chris F.A. Johnson wrote:


>> On 2008-07-20, heavytull wrote:
>>> does anyone know the difference between running an application in the
>>> two following ways?
>>>
>>> #/sbin/'any_binary'
>>> and
>>> #/sbin//'any_binary'

>>
>> There is no difference; // is the same as /.


>is it same with | and ||?

No.

Nor is it the same with a and aa

Reply With Quote
  #5 (permalink)  
Old 07-22-2008, 01:55 PM
Man-wai Chang ToDie (33.6k)
 
Posts: n/a
Re: diference between single slash and double

> #/sbin//'any_binary'

"//" means a real single character "/" in certain programming languages.

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04) Linux 2.6.26
^ ^ 21:53:01 up 8 days 1:18 6 users load average: 1.01 1.00 1.00
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_...ub_addressesa/
Reply With Quote
  #6 (permalink)  
Old 07-22-2008, 02:00 PM
Man-wai Chang ToDie (33.6k)
 
Posts: n/a
Re: diference between single slash and double

Man-wai Chang ToDie (33.6k) wrote:
>> #/sbin//'any_binary'

>
> "//" means a real single character "/" in certain programming languages.
>


the first "/" is called an escape character.

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04) Linux 2.6.26
^ ^ 21:59:01 up 8 days 1:24 6 users load average: 1.43 1.17 1.06
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_...ub_addressesa/
Reply With Quote
  #7 (permalink)  
Old 07-22-2008, 03:24 PM
Unruh
 
Posts: n/a
Re: diference between single slash and double

"Man-wai Chang ToDie (33.6k)" <toylet.toylet@gmail.com> writes:

>Man-wai Chang ToDie (33.6k) wrote:
>>> #/sbin//'any_binary'

>>
>> "//" means a real single character "/" in certain programming languages.
>>


>the first "/" is called an escape character.


Uh, no. you got your slashes turned around -\\ is a single \ in shell
programming. But in a path in the unix filesystem, // means the same as /
and / is not an escape character. This is to make shell scripting easier.
eg you could have defines
A= /usr/local/
and later used
${A}/bin/program
to run a program. That expands to /usr/local//bin/program. If that // were
not interpreted as / this would mean you would have to be very careful in
defining your variables-- unnecessarily so since there is nothing that //
could mean but /



>--
> @~@ Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
>/( _ )\ (Xubuntu 8.04) Linux 2.6.26
> ^ ^ 21:59:01 up 8 days 1:24 6 users load average: 1.43 1.17 1.06
>? ? (CSSA):
>http://www.swd.gov.hk/tc/index/site_...ub_addressesa/

Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:16 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Personal Loans | Odzyskiwanie danych | Personals | Fast Loans | EarthforEnergy



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109