Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:22:44+00:00 2026-05-25T19:22:44+00:00

I am using a shell script in Jenkins that, at a certain point, uploads

  • 0

I am using a shell script in Jenkins that, at a certain point, uploads a file to a server using curl. I would like to see whatever output curl produces but also check whether it is the output I expect. If it isn’t, then I want to set the shell error code to > 0 so that Jenkins knows the script failed.

I first tried using curl -f, but this causes the pipe to be cut as soon as the upload fails and the error output never gets to the client. Then I tried something like this:

curl ...params... | tee /dev/tty | \
  xargs -I{} test "Expected output string" = '{}'

This works from a normal SSH shell but in the Jenkins console output I see:

tee: /dev/tty: No such device or address

I’m not sure why this is since I thought Jenkins was communicating with the slave using a normal SSH shell. In any case, the whole xargs + test thing strikes me as a bit of a hack.

Is there a way to accomplish this in Jenkins so that I can see the output and also test whether it matches a specific string?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:22:44+00:00Added an answer on May 25, 2026 at 7:22 pm

    When Jenkins communicates with slave via SSH, there is no terminal allocated, and so there is no /dev/tty device for that process.

    Maybe you can send it to /dev/stderr instead? It will be a terminal in an interactive session and some log file in non-interactive session.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i insert lines into a file using shell script such that they
I am using the wc utility in a shell script that I run from
I have the following shell script that I've been using in previous versions of
If I launched a shell script using AuthorizationExecuteWithPrivileges what would be the easiest way
I am reading one property file which contains some file paths using shell script.
I'm working on a project that essentially creates files via a shell script using
Using a shell script, I'd like to find all directories within a directory (not
How to compare two property files in two different folders using shell script input
I'm trying to get the contents of a directory using shell script. My script
I'm trying to get the contents of a directory using shell script. My script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.