Re: Shell Script:Help Required.

Abhijit Menon-Sen <[email protected]> Wed, 1 Sep 2004 18:21:10 +0530
Newsgroups gmane.user-groups.linux.delhi.devel
Message-ID <[email protected]>
At 2004-09-01 18:10:36 +0530, [email protected] wrote:
>
> Dont know about /proc/self/fd myself. How do you use it in this
> particular case?

Like this:

    $ cat > x && chmod +x x
    #!/bin/sh
    readlink /proc/self/fd/1
    $ ./x
    /dev/pts/22
    $ ./x > foo && cat foo
    /home/ams/foo

Of course, doing something like that would make your script unportable
outside Linux.

-- ams