Skip to content

NSH I/O redirection and I/O operation doesn't work and incomplete #12792

@acassis

Description

@acassis

This issue was reported by @casaroli and I'm just reporting here to avoid forgetting about it.

Works: ">"

nsh> ls / > /tmp/files.txt

nsh> cat /tmp/files.txt
/:
bin/
dev/
etc/
proc/
tmp/
nsh>

Works: ">>"

nsh> ls /dev >> /tmp/files.txt

nsh> cat /tmp/files.txt
/:
bin/
dev/
etc/
proc/
tmp/
/dev:
console
gpio0
gpio1
gpio2
gpio3
loop
null
oneshot
ram0
ram1
ram2
zero
nsh>

Doesn't work: "<"

nsh> cat < /tmp/files.txt
nsh: cat: open failed: 2
nsh>

Doesn't work: "|"

nsh> cat /tmp/files.txt | cat
/:
bin/
dev/
etc/
proc/
tmp/
nsh: cat: open failed: 2
nsh>

Doesn't work: "2>"

nsh> cat /tmp/doesexist.txt 2> /tmp/error.txt
nsh: cat: open failed: 2
nsh> ls -l /tmp
/tmp:
-rw-rw-rw- 122 files.txt
nsh>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions