Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #90165 > unrolled thread

/dev/tcp

Started byEli the Bearded <*@eli.users.panix.com>
First post2026-08-19 21:20 +0000
Last post2026-08-23 16:13 +0100
Articles 20 on this page of 41 — 13 participants

Back to article view | Back to comp.os.linux.misc


Contents

  /dev/tcp Eli the Bearded <*@eli.users.panix.com> - 2026-08-19 21:20 +0000
    Re: /dev/tcp Richard Kettlewell <invalid@invalid.invalid> - 2026-08-19 23:53 +0100
    Re: /dev/tcp Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-19 23:42 +0000
      Re: /dev/tcp Eli the Bearded <*@eli.users.panix.com> - 2026-08-20 00:59 +0000
        Re: /dev/tcp Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-20 03:59 +0000
          Re: /dev/tcp Nuno Silva <nunojsilva@invalid.invalid> - 2026-08-20 10:10 +0100
          Re: /dev/tcp Eli the Bearded <*@eli.users.panix.com> - 2026-08-20 18:15 +0000
            Re: /dev/tcp Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-20 23:30 +0000
              Re: /dev/tcp Nuno Silva <nunojsilva@invalid.invalid> - 2026-08-21 01:18 +0100
              Re: /dev/tcp Marc Haber <mh+usenetspam2616@zugschl.us> - 2026-08-21 09:52 +0200
                Re: /dev/tcp Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-21 08:12 +0000
                  Re: /dev/tcp Marc Haber <mh+usenetspam2616@zugschl.us> - 2026-08-21 11:16 +0200
                    Re: /dev/tcp Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-21 22:57 +0000
                      Re: /dev/tcp Marc Haber <mh+usenetspam2616@zugschl.us> - 2026-08-22 06:17 +0200
                Re: /dev/tcp c186282 <c186282@nnada.net> - 2026-08-21 21:50 -0400
              Re: /dev/tcp vallor <vallor@vallor.earth> - 2026-08-23 00:56 +0000
                Re: /dev/tcp Rich <rich@example.invalid> - 2026-08-23 04:01 +0000
                  Re: /dev/tcp c186282 <c186282@nnada.net> - 2026-08-23 03:37 -0400
                    Re: /dev/tcp "Carlos E.R." <robin_listas@es.invalid> - 2026-08-23 13:50 +0200
                    Re: /dev/tcp The Natural Philosopher <tnp@invalid.invalid> - 2026-08-23 12:52 +0100
                  Re: /dev/tcp The Natural Philosopher <tnp@invalid.invalid> - 2026-08-23 12:50 +0100
    Re: /dev/tcp Rich <rich@example.invalid> - 2026-08-20 13:50 +0000
      Re: /dev/tcp c186282 <c186282@nnada.net> - 2026-08-20 13:02 -0400
        Re: /dev/tcp Rich <rich@example.invalid> - 2026-08-20 18:26 +0000
        Re: /dev/tcp The Natural Philosopher <tnp@invalid.invalid> - 2026-08-21 13:54 +0100
          Re: /dev/tcp c186282 <c186282@nnada.net> - 2026-08-21 22:57 -0400
            Re: /dev/tcp "Carlos E.R." <robin_listas@es.invalid> - 2026-08-22 21:47 +0200
              The hammer is best (Was: /dev/tcp) gazelle@shell.xmission.com (Kenny McCormack) - 2026-08-22 23:50 +0000
                Re: The hammer is best (Was: /dev/tcp) c186282 <c186282@nnada.net> - 2026-08-23 04:28 -0400
                Re: The hammer is best Richard Kettlewell <invalid@invalid.invalid> - 2026-08-23 10:14 +0100
                  Re: The hammer is best "Carlos E.R." <robin_listas@es.invalid> - 2026-08-23 13:55 +0200
                    Re: The hammer is best The Natural Philosopher <tnp@invalid.invalid> - 2026-08-23 13:16 +0100
                      Re: The hammer is best Marc Haber <mh+usenetspam2616@zugschl.us> - 2026-08-23 21:20 +0200
        Re: /dev/tcp Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2026-08-21 13:41 +0100
          Re: /dev/tcp Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-21 22:58 +0000
          Re: /dev/tcp c186282 <c186282@nnada.net> - 2026-08-21 22:28 -0400
      Re: /dev/tcp Eli the Bearded <*@eli.users.panix.com> - 2026-08-20 18:22 +0000
        Re: /dev/tcp The Natural Philosopher <tnp@invalid.invalid> - 2026-08-21 13:57 +0100
    Re: /dev/tcp Lars Poulsen <lars@beagle-ears.com> - 2026-08-23 06:37 -0700
      Re: /dev/tcp Richard Kettlewell <invalid@invalid.invalid> - 2026-08-23 14:49 +0100
      Re: /dev/tcp The Natural Philosopher <tnp@invalid.invalid> - 2026-08-23 16:13 +0100

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#90386

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2026-08-23 12:50 +0100
Message-ID<116emqf$1sako$5@dont-email.me>
In reply to#90370
On 23/08/2026 05:01, Rich wrote:
>> Have you ever agreed with someone?
> It's kind of the troll ethos, disagreeing brings on more chaos.

LOL...

-- 
"The great thing about Glasgow is that if there's a nuclear attack it'll 
look exactly the same afterwards."

Billy Connolly

[toc] | [prev] | [next] | [standalone]


#90207

FromRich <rich@example.invalid>
Date2026-08-20 13:50 +0000
Message-ID<11670nh$3hihn$1@dont-email.me>
In reply to#90165
Eli the Bearded <*@eli.users.panix.com> wrote:
> What system(s) have /dev/tcp/* natively?

What "systems"?  Only those with a /bin/bash compiled with this 
"special bash feature" compiled in.

>   $ man bash
>   [...]
>   REDIRECTION
>   [...]
>        Bash handles several filenames specially when they are used in
>        redirections,  as described  in the  following table.   If the
>        operating  system on  which  bash is  running  provides  these
>        special files, bash will use them;  other wise it will emulate
>        them internally with the behavior described below.
>   [...]
>               /dev/tcp/host/port
>                   If  host  is a valid  hostname or Internet address,
>                   and port is an integer port number or service name,
>                   bash attempts to open the corresponding TCP socket.
> 
> I don't see it on the various systems I have handy (Debian 13, Amazon
> Linux 2023, Mac OS 15.7.x, NetBSD 10.1, Android 14).

> is it a plan9 thing?

It's a Bash feature.  Note the man page quote you provided:

>  **Bash** handles several filenames specially when they are used in 
>  redirections

These are handled by Bash, they don't exist as part of the OS (system).

[toc] | [prev] | [next] | [standalone]


#90219

Fromc186282 <c186282@nnada.net>
Date2026-08-20 13:02 -0400
Message-ID<jLednbRwA9SGrhr3nZ2dnZfqn_udnZ2d@giganews.com>
In reply to#90207
On 8/20/26 09:50, Rich wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
>> What system(s) have /dev/tcp/* natively?
> 
> What "systems"?  Only those with a /bin/bash compiled with this
> "special bash feature" compiled in.
> 
>>    $ man bash
>>    [...]
>>    REDIRECTION
>>    [...]
>>         Bash handles several filenames specially when they are used in
>>         redirections,  as described  in the  following table.   If the
>>         operating  system on  which  bash is  running  provides  these
>>         special files, bash will use them;  other wise it will emulate
>>         them internally with the behavior described below.
>>    [...]
>>                /dev/tcp/host/port
>>                    If  host  is a valid  hostname or Internet address,
>>                    and port is an integer port number or service name,
>>                    bash attempts to open the corresponding TCP socket.
>>
>> I don't see it on the various systems I have handy (Debian 13, Amazon
>> Linux 2023, Mac OS 15.7.x, NetBSD 10.1, Android 14).
> 
>> is it a plan9 thing?
> 
> It's a Bash feature.  Note the man page quote you provided:
> 
>>   **Bash** handles several filenames specially when they are used in
>>   redirections
> 
> These are handled by Bash, they don't exist as part of the OS (system).

   Correct. I've used the /dev/tcp trick before to
   check ports. Seems to only work with Bash. Others
   might add it eventually, but not too likely.

   Other odd Linux tricks - how many know you can
   read/write to a disk drive that has no file
   system ? GParted does have an option that creates
   a "blank" drive. It's an old trick, squeeze in
   more raw data. To a degree, it can make that data
   a bit more "portable" because it's not tied to
   EXT?/NTFS/XFS/etc. You just need a system that
   can open the 'blank' as an I/O device.

[toc] | [prev] | [next] | [standalone]


#90227

FromRich <rich@example.invalid>
Date2026-08-20 18:26 +0000
Message-ID<1167gt3$3neg1$1@dont-email.me>
In reply to#90219
c186282 <c186282@nnada.net> wrote:
>   Other odd Linux tricks - how many know you can
>   read/write to a disk drive that has no file
>   system ?

That is not a Linux trick, that's a Unix feature given that devices are 
mapped to files.

Just write your data to /dev/sda (whole disk, including boot sector) or 
/dev/sda5 (5th partition on disk).

That is where the 'dd' command is useful.  You can "clone" a disk on 
Unix (if you are root, or if the two disk device files have write 
permission for your current user) by just doing:

dd if=/dev/sda of=/dev/sdb bs=4096 

Assuming the disks use 4096 byte sectors.  

No need for extra "disk cloning" machines to actually duplicate a disk.

You can also backup the same way (although it is a rather wasteful way, 
as you also backup all the empty "free space" too):

dd if=/dev/sda of=/tmp/disk-backup bs=4096

None of this is new to anyone who's used, and understood from an admin 
perspective, a Unix system for any short length of time.

[toc] | [prev] | [next] | [standalone]


#90281

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2026-08-21 13:54 +0100
Message-ID<1169hp9$9sqa$13@dont-email.me>
In reply to#90219
On 20/08/2026 18:02, c186282 wrote:
> Other odd Linux tricks - how many know you can
>    read/write to a disk drive that has no file
>    system ?
Of course. Done all the time with floppies

Just write to the raw device.

After all, at some level some part of Linux has to do that anyway even 
if it is writing to a file.


-- 
"An intellectual is a person knowledgeable in one field who speaks out 
only in others...”

Tom Wolfe

[toc] | [prev] | [next] | [standalone]


#90314

Fromc186282 <c186282@nnada.net>
Date2026-08-21 22:57 -0400
Message-ID<36ucnepaq_p9khT3nZ2dnZfqnPednZ2d@giganews.com>
In reply to#90281
On 8/21/26 08:54, The Natural Philosopher wrote:
> On 20/08/2026 18:02, c186282 wrote:
>> Other odd Linux tricks - how many know you can
>>    read/write to a disk drive that has no file
>>    system ?
> Of course. Done all the time with floppies
> 
> Just write to the raw device.
> 
> After all, at some level some part of Linux has to do that anyway even 
> if it is writing to a file.

   It used to be popular for holding the max amount
   of binary data - no space wasted with the file
   system setup.

   A few years back I leveraged it for a disk-wipe
   program. Problem was that disks have become SO
   huge ... had to use M$ 128/256-bit var classes to
   access the whole thing.

   E-Disks ... can't REALLY wipe 'em alas. There
   are hidden buffers plus the wear-leveling scheme
   gets in the way. You wipe 'em the Hillary Clinton
   way - HAMMER  :-)

[toc] | [prev] | [next] | [standalone]


#90353

From"Carlos E.R." <robin_listas@es.invalid>
Date2026-08-22 21:47 +0200
Message-ID<fvaplmx3co.ln2@Telcontar.valinor>
In reply to#90314
On 2026-08-22 04:57, c186282 wrote:
> On 8/21/26 08:54, The Natural Philosopher wrote:
>> On 20/08/2026 18:02, c186282 wrote:
>>> Other odd Linux tricks - how many know you can
>>>    read/write to a disk drive that has no file
>>>    system ?
>> Of course. Done all the time with floppies
>>
>> Just write to the raw device.
>>
>> After all, at some level some part of Linux has to do that anyway even 
>> if it is writing to a file.
> 
>    It used to be popular for holding the max amount
>    of binary data - no space wasted with the file
>    system setup.
> 
>    A few years back I leveraged it for a disk-wipe
>    program. Problem was that disks have become SO
>    huge ... had to use M$ 128/256-bit var classes to
>    access the whole thing.
> 
>    E-Disks ... can't REALLY wipe 'em alas. There
>    are hidden buffers plus the wear-leveling scheme
>    gets in the way. You wipe 'em the Hillary Clinton
>    way - HAMMER  :-)

Instead, use encryption, on the device or the partitions.

-- 
Cheers, Carlos.
ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#90363 — The hammer is best (Was: /dev/tcp)

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2026-08-22 23:50 +0000
SubjectThe hammer is best (Was: /dev/tcp)
Message-ID<116dcl1$3hva0$1@news.xmission.com>
In reply to#90353
In article <fvaplmx3co.ln2@Telcontar.valinor>,
Carlos E.R. <robin_listas@es.invalid> wrote:
...
>>   are hidden buffers plus the wear-leveling scheme
>>   gets in the way. You wipe 'em the Hillary Clinton
>>   way - HAMMER :-)
>
>Instead, use encryption, on the device or the partitions.

Hammer is better, because encryption can be worked around by holding a gun
to the head of the person who knows the encryption key.

But a hammer is forever.

-- 
Trump has normalized hate.

The media has normalized Trump.

[toc] | [prev] | [next] | [standalone]


#90378 — Re: The hammer is best (Was: /dev/tcp)

Fromc186282 <c186282@nnada.net>
Date2026-08-23 04:28 -0400
SubjectRe: The hammer is best (Was: /dev/tcp)
Message-ID<j72cnbBzwudjMxf3nZ2dnZfqnPudnZ2d@giganews.com>
In reply to#90363
On 8/22/26 19:50, Kenny McCormack wrote:
> In article <fvaplmx3co.ln2@Telcontar.valinor>,
> Carlos E.R. <robin_listas@es.invalid> wrote:
> ...
>>>    are hidden buffers plus the wear-leveling scheme
>>>    gets in the way. You wipe 'em the Hillary Clinton
>>>    way - HAMMER :-)
>>
>> Instead, use encryption, on the device or the partitions.
> 
> Hammer is better, because encryption can be worked around by holding a gun
> to the head of the person who knows the encryption key.

   Usually they'll write it on a Post-It and stick
   it to their monitor :-)

   Also, encryption is only really great if someone
   physically STEALS yer disk - pretty rare. If yer
   system is up and the drives unlocked then they
   can spy and steal from those far more easily.

> But a hammer is forever.

   Yep !

   When I retired I had like 25 old mag drives -
   a VERY heavy box full.

   First ran a wipe app I'd writ on them.

   Then ...

   Took 'em to The Shop, drill press ... put a
   half-inch hole through the top and platters.

   More than Good Enough.

   DID hate wasting all those neo magnets though ...
   and HAD removed them from many drives. But, it was
   bail-out time, so Rude & Crude ........

   A "cold chisel" and a big hammer works too.

   Still have a few 'mobiles' of HDD platters  :-)

[toc] | [prev] | [next] | [standalone]


#90379 — Re: The hammer is best

FromRichard Kettlewell <invalid@invalid.invalid>
Date2026-08-23 10:14 +0100
SubjectRe: The hammer is best
Message-ID<wwvmrudkxkf.fsf@LkoBDZeT.terraraq.uk>
In reply to#90363
gazelle@shell.xmission.com (Kenny McCormack) writes:
> Carlos E.R. <robin_listas@es.invalid> wrote:
> ...
>>>   are hidden buffers plus the wear-leveling scheme
>>>   gets in the way. You wipe 'em the Hillary Clinton
>>>   way - HAMMER :-)
>>
>> Instead, use encryption, on the device or the partitions.
>
> Hammer is better, because encryption can be worked around by holding a
> gun to the head of the person who knows the encryption key.

My backup drives are encrypted. In principle they could be stolen from
here, from an offsite location or in transit and if that happens I won’t
have the opportunity to destroy it.

The chances that someone would threaten my life or liberty over it are
negligible, but if they did, they wouldn’t need to wait for a device to
be disposed of, they’d just turn up at my door with a weapon, RIPA
notice or other leverage.

Physical destruction is not really relevant for most of the lifetime of
confidential data, and encryption does actually achieve something useful
in realistic use cases.

High value data is protected by keys that no human knows.

-- 
https://www.greenend.org.uk/rjk/

[toc] | [prev] | [next] | [standalone]


#90389 — Re: The hammer is best

From"Carlos E.R." <robin_listas@es.invalid>
Date2026-08-23 13:55 +0200
SubjectRe: The hammer is best
Message-ID<gm3rlmxqg4.ln2@Telcontar.valinor>
In reply to#90379
On 2026-08-23 11:14, Richard Kettlewell wrote:
> gazelle@shell.xmission.com (Kenny McCormack) writes:
>> Carlos E.R. <robin_listas@es.invalid> wrote:
>> ...
>>>>    are hidden buffers plus the wear-leveling scheme
>>>>    gets in the way. You wipe 'em the Hillary Clinton
>>>>    way - HAMMER :-)
>>>
>>> Instead, use encryption, on the device or the partitions.
>>
>> Hammer is better, because encryption can be worked around by holding a
>> gun to the head of the person who knows the encryption key.
> 
> My backup drives are encrypted. In principle they could be stolen from
> here, from an offsite location or in transit and if that happens I won’t
> have the opportunity to destroy it.

Exactly.

And in the typical business case, hammering of disks is not often done. 
Hard disks are simply repurposed, recycled, sold... usually zeroing them 
first. Encryption protects the case when zeroing is forgotten, or the 
disk breaks before that. Encryption protects against such accidents.


> 
> The chances that someone would threaten my life or liberty over it are
> negligible, but if they did, they wouldn’t need to wait for a device to
> be disposed of, they’d just turn up at my door with a weapon, RIPA
> notice or other leverage.
> 
> Physical destruction is not really relevant for most of the lifetime of
> confidential data, and encryption does actually achieve something useful
> in realistic use cases.
> 
> High value data is protected by keys that no human knows.
> 


-- 
Cheers, Carlos.
ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#90392 — Re: The hammer is best

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2026-08-23 13:16 +0100
SubjectRe: The hammer is best
Message-ID<116eoal$1sako$9@dont-email.me>
In reply to#90389
On 23/08/2026 12:55, Carlos E.R. wrote:
> On 2026-08-23 11:14, Richard Kettlewell wrote:
>> gazelle@shell.xmission.com (Kenny McCormack) writes:
>>> Carlos E.R. <robin_listas@es.invalid> wrote:
>>> ...
>>>>>    are hidden buffers plus the wear-leveling scheme
>>>>>    gets in the way. You wipe 'em the Hillary Clinton
>>>>>    way - HAMMER :-)
>>>>
>>>> Instead, use encryption, on the device or the partitions.
>>>
>>> Hammer is better, because encryption can be worked around by holding a
>>> gun to the head of the person who knows the encryption key.
>>
>> My backup drives are encrypted. In principle they could be stolen from
>> here, from an offsite location or in transit and if that happens I won’t
>> have the opportunity to destroy it.
> 
> Exactly.
> 
> And in the typical business case, hammering of disks is not often done. 

It is UNIVERSALLY done in the UK.
Insurance will be voided, contracts lost  and people will get fired if 
it is not.

The big sources of usable hardware are BIG corporates - banks, insurance 
companies, travel agencies... they dump a thousand machines a year to 
recycling companies who sign in blood that the disk will be CRUSHED.

> Hard disks are simply repurposed, recycled, sold... usually zeroing them 
> first. Encryption protects the case when zeroing is forgotten, or the 
> disk breaks before that. Encryption protects against such accidents.
> 
No, they are not. Not by corporations. Some Mickey Mouse companies with 
nothing worth stealing might...


-- 
The higher up the mountainside
The greener grows the grass.
The higher up the monkey climbs
The more he shows his arse.

Traditional

[toc] | [prev] | [next] | [standalone]


#90410 — Re: The hammer is best

FromMarc Haber <mh+usenetspam2616@zugschl.us>
Date2026-08-23 21:20 +0200
SubjectRe: The hammer is best
Message-ID<116fh62$kokl$1@news1.tnib.de>
In reply to#90392
The Natural Philosopher <tnp@invalid.invalid> wrote:
>On 23/08/2026 12:55, Carlos E.R. wrote:
>> Hard disks are simply repurposed, recycled, sold... usually zeroing them 
>> first. Encryption protects the case when zeroing is forgotten, or the 
>> disk breaks before that. Encryption protects against such accidents.
>> 
>No, they are not. Not by corporations. Some Mickey Mouse companies with 
>nothing worth stealing might...

Corporations still act on the customs of the 2000 years because using
their brains costs money that doesn't land in budgets where the money
to destroy disks is already booked.

Greetings
Marc
-- 
----------------------------------------------------------------------------
Marc Haber         |   " Questions are the         | Mailadresse im Header
Rhein-Neckar, DE   |     Beginning of Wisdom "     | 
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 6224 1600402

[toc] | [prev] | [next] | [standalone]


#90284

FromGeoff Clare <geoff@clare.See-My-Signature.invalid>
Date2026-08-21 13:41 +0100
Message-ID<bltllm-fgq.ln1@ID-313840.user.individual.net>
In reply to#90219
c186282 wrote:

> On 8/20/26 09:50, Rich wrote:
>> 
>> These are handled by Bash, they don't exist as part of the OS (system).
> 
>    Correct. I've used the /dev/tcp trick before to
>    check ports. Seems to only work with Bash. Others
>    might add it eventually, but not too likely.

According to https://mywiki.wooledge.org/BashFAQ/061 the feature was
added to bash in version 2.04 and was "Copied from / Inspired by" ksh93.

It certainly works in the versions of ksh93 I have.

-- 
Geoff Clare <netnews@gclare.org.uk>

[toc] | [prev] | [next] | [standalone]


#90303

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-21 22:58 +0000
Message-ID<116al76$m98h$8@dont-email.me>
In reply to#90284
On Fri, 21 Aug 2026 13:41:47 +0100, Geoff Clare wrote:

> According to https://mywiki.wooledge.org/BashFAQ/061 the feature was
> added to bash in version 2.04 and was "Copied from / Inspired by"
> ksh93.
>
> It certainly works in the versions of ksh93 I have.

Whatever happened to the idea of “do one thing, and do it well” ... ?

[toc] | [prev] | [next] | [standalone]


#90313

Fromc186282 <c186282@nnada.net>
Date2026-08-21 22:28 -0400
Message-ID<36ucnetaq_q4lBT3nZ2dnZfqnPednZ2d@giganews.com>
In reply to#90284
On 8/21/26 08:41, Geoff Clare wrote:
> c186282 wrote:
> 
>> On 8/20/26 09:50, Rich wrote:
>>>
>>> These are handled by Bash, they don't exist as part of the OS (system).
>>
>>     Correct. I've used the /dev/tcp trick before to
>>     check ports. Seems to only work with Bash. Others
>>     might add it eventually, but not too likely.
> 
> According to https://mywiki.wooledge.org/BashFAQ/061 the feature was
> added to bash in version 2.04 and was "Copied from / Inspired by" ksh93.
> 
> It certainly works in the versions of ksh93 I have.

   You run ksh93 ???

   Not too many Kornies left these days :-)

[toc] | [prev] | [next] | [standalone]


#90226

FromEli the Bearded <*@eli.users.panix.com>
Date2026-08-20 18:22 +0000
Message-ID<eli$2608201422@qaz.wtf>
In reply to#90207
In comp.os.linux.misc, Rich  <rich@example.invalid> wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
>> What system(s) have /dev/tcp/* natively?
> What "systems"?  Only those with a /bin/bash compiled with this 
> "special bash feature" compiled in.

None is a potential answer.

>>        Bash handles several filenames specially when they are used in
>>        redirections,  as described  in the  following table.   If the
                                                                  ^^^^^^
>>        operating  system on  which  bash is  running  provides  these
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>        special files, bash will use them;  other wise it will emulate
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>        them internally with the behavior described below.

> It's a Bash feature.  Note the man page quote you provided:
>>  **Bash** handles several filenames specially when they are used in 
>>  redirections

Note the underlined bit. In my mind "emulate" implies there is a thing
that does this, because the dictionary definition of "emulate" is very
close to "immitate".

From WordNet (r) 3.0 (2006) [wn]:
 
  emulate
      v 1: strive to equal or match, especially by imitating; "He is
           emulating the skating skills of his older sister"
      2: imitate the function of (another system), as by modifying the
         hardware or the software
      3: compete with successfully; approach or reach equality with;
         "This artist's drawings cannot emulate his water colors"

Note how there is nothing there about "make up whole cloth" or
"completely implement without reference to something else."

Elijah
------
realizes some documentation is fiction

[toc] | [prev] | [next] | [standalone]


#90282

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2026-08-21 13:57 +0100
Message-ID<1169hve$9sqa$14@dont-email.me>
In reply to#90226
On 20/08/2026 19:22, Eli the Bearded wrote:
> Note the underlined bit. In my mind "emulate" implies there is a thing
> that does this, because the dictionary definition of "emulate" is very
> close to "imitate".

Emulation carries a strong implication of arriving at the same result by 
a radically different means, whereas imitate attempts to simply 
duplicate the method.
e.g. software models emulate the real world, they do not imitate it.



-- 
“It is hard to imagine a more stupid decision or more dangerous way of 
making decisions than by putting those decisions in the hands of people 
who pay no price for being wrong.”

Thomas Sowell

[toc] | [prev] | [next] | [standalone]


#90397

FromLars Poulsen <lars@beagle-ears.com>
Date2026-08-23 06:37 -0700
Message-ID<116et2h$1v2in$1@dont-email.me>
In reply to#90165
On 2026-08-19 14:20, Eli the Bearded wrote:
> What system(s) have /dev/tcp/* natively?
>    [...]
>                /dev/tcp/host/port
> 		  If  host  is a valid  hostname or Internet address,
> 		  and port is an integer port number or service name,
> 		  bash attempts to open the corresponding TCP socket.

After several days, we have now ascertained that nobody ever implemented 
this with a true device interface - it is a fiction implemented by the 
shell intercepting the filename and diverting it.

Which is kinda strange. It seems like it should be easier to really do 
it as a true device interface. It would be easier for quick-and-dirty 
programs than the socket interface. Maybe the problem is the DNS lookup 
would have to be done below the kernel boundary? But would it really be 
that much harder than the weird stuff done with virtual file systems?

-- 
Lars Poulsen - an old geek in Santa Barbara, California

[toc] | [prev] | [next] | [standalone]


#90398

FromRichard Kettlewell <invalid@invalid.invalid>
Date2026-08-23 14:49 +0100
Message-ID<wwv33w5aquz.fsf@LkoBDZeT.terraraq.uk>
In reply to#90397
Lars Poulsen <lars@beagle-ears.com> writes:
> Eli the Bearded wrote:
>> What system(s) have /dev/tcp/* natively?
>>    [...]
>>                /dev/tcp/host/port
>> 		  If  host  is a valid  hostname or Internet address,
>> 		  and port is an integer port number or service name,
>> 		  bash attempts to open the corresponding TCP socket.
>
> After several days, we have now ascertained that nobody ever
> implemented this with a true device interface - it is a fiction
> implemented by the shell intercepting the filename and diverting it.
>
> Which is kinda strange. It seems like it should be easier to really do
> it as a true device interface. It would be easier for quick-and-dirty
> programs than the socket interface.

A magic filename would only be useful if it worked everywhere or if you
were only targetting the platform(s) that supported it. All the failure
modes would have to be compressed into a single errno value.

In contrast getaddrinfo+socket+connect is only a few lines of code, it
works everywhere, and you can easily tell the end user which part of the
process failed, when it doesn’t work.

> Maybe the problem is the DNS lookup would have to be done below the
> kernel boundary? But would it really be that much harder than the
> weird stuff done with virtual file systems?

The Linux kernel can already call up to userspace to do DNS lookups:
https://docs.kernel.org/networking/dns_resolver.html

-- 
https://www.greenend.org.uk/rjk/

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.os.linux.misc


csiph-web