[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    hush: stdin of interactive shell is not restored after executing a builtin command
From:       Deweloper <deweloper () wp ! pl>
Date:       2019-10-28 22:28:19
Message-ID: 74b6190a6e754f82870362b24740a15c () grupawp ! pl
[Download RAW message or body]

Hi,

Please try to read a value from a file in an interactive shell.
Example:
--- cut here
echo test > tmp1
read < tmp1
echo $REPLY
--- cut here

Current result: hush exits before "echo $REPLY"
Expected result: hush prints "test" and prompts for next command

It seems that the redirection of stdin isn't cleaned up when command
finishes. Please have a look at following script:

--- cut here
echo before:
readlink /proc/self/fd/0 /proc/self/fd/1
: < /dev/null > /dev/null
echo after:
readlink /proc/self/fd/0 /proc/self/fd/1
--- cut here

and it's output in hush:

--- cut here
before:
/dev/pts/17
/dev/pts/17
after:
/dev/null
/dev/pts/17
--- cut here

Expected result is equal both "before" and "after".
Current result means that a script cannot continue to process data from
stdin if it had to grab some auxiliary data from somewhere else.

-- 

["redir_input.right" (application/octet-stream)]
["redir_input.tests" (application/octet-stream)]

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic