Skip to content

Expression (if,while) get command exit code '{ }' to support redirection to /dev/null or no output at all #113

@c-pointer

Description

@c-pointer

I don't know if it is bug or enhancement but

This works

if ( { ping -c 1 -w 1 192.168.0.1 } ) then
  echo "LAN is up"
endif

This does not works (works but redirection does not)

if ( { ping -c 1 -w 1 192.168.0.1 >& /dev/null } ) then
  echo "LAN is up"
endif

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