Skip to content

how to identify if sd command failed? #314

@blueray453

Description

@blueray453

I have tried:

sd "${file}.*\n?" "" "$BATCH_FILE" && echo -e "\033[0;34m$ICON_SUCCESS Lines containing $file removed from $BATCH_FILE\033[0m"

and

if sd "${file}.*\n?" "" "$BATCH_FILE"; then
  echo -e "\033[0;34m$ICON_SUCCESS Lines containing $file removed from $BATCH_FILE\033[0m"
fi

and

sd "${file}.*\n?" "" "$BATCH_FILE"

if [[ $? -eq 0 ]]; then
  echo -e "\033[0;34m$ICON_SUCCESS Lines containing $file removed from $BATCH_FILE\033[0m"
fi

It echoes line even if the command fails.

how to identify if sd command failed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: CLI, completions, exit codes oh myC-enhancementCategory: New feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions