InsideDarkWeb.com

Linux - grep is not working as expected in CircleCI

My laptop is Mac and CircleCI uses Linux and I have to run shell script in CircleCI like below.

SOME_ERROR_TEXT="some error text verbose verbose"

if yarn schema-codegen | grep "$SOME_ERROR_TEXT"; then
  echo "success!"
  exit 1
else
  echo "failure!"
fi

The result of yarn schmea-codegen contains SOME_EROR_TEXT.

some error text verbose verbose lorem ipsum dfaskldjfskdljfldsakjfkldsjflksdjf
dsflsdjflkjdsfjlkdsjfljdslkfjlkdsjfjdsljfldsjfkjjj
     11123123213123
 '''''

This script is working on my Mac, but it is not working on CircleCI environment. Is there wrong syntax in my script? If not, I will solve this problem on CI. Thanks

Unix & Linux Asked on November 21, 2021

0 Answers

Add your own answers!

Related Questions

How do I syntax check a Zsh script?

1  Asked on August 9, 2020 by akhil-jalagam

     

How can I swap my two screens, left to right?

5  Asked on August 4, 2020 by ripper234

         

Adding suffix to filename during for loop in bash

1  Asked on August 3, 2020 by mishal-ahmed

       

Why are aliases skipped if escaped?

2  Asked on August 2, 2020

     

Why can’t I type a g̃ the same way I type ñ?

1  Asked on July 29, 2020 by mmaluff

         

Custom logrotate with hostnames

0  Asked on July 29, 2020 by gwynn

     

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.