The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
15 views

How to save a document and close it after the save

Currently I have a .bat file that opens a program, opens a document and then reloads this document so it contains new data. After that I need a timeout so it can run some other things within the ...
0
votes
1answer
26 views

Check shell Script copy Status

I have a cron script and i need to adjust it; Actually some clients are generating in a directory some files, my task is to backup that files to a tape, and i need to make a if then else cp $files ...
1
vote
2answers
44 views

How to find files which do not contain their own filename

When using templates to generating files, it's important to include the template's name inside the template. When reading a generated file, it helps you find the template used to generate it. I want ...
0
votes
1answer
95 views

How do I run multiple scripts within a script, even if one script fails

I have a simple bash script that executes a number of other scripts … #/bin/bash … ./update_artifact1.sh $ARTIFACT_VERSION ./update_artifact2.sh $ARTIFACT_VERSION ./update_artifact3.sh ...
1
vote
2answers
155 views

How do you use PIPESTATUS, tee and /bin/sh together?

When I run curl | tee test.txt; echo ${PIPESTATUS[0]} I correctly see curl: try 'curl --help' or 'curl --manual' for more information 2 But when I try to run exactly same command using ...
1
vote
0answers
56 views

trying to install windows hotfix, but getting a negative exit code

I am trying to install windows-8-RT kb2771744 hotfix. I am getting a negative exit code: -2125124329 I converted that into hex: 7FDBFFE9 I looked around, I am not sure what to make of it.
8
votes
2answers
2k views

Can I make cURL fail with an exitCode different than 0 if the HTTP status code is not 200?

I was always assuming that when curl got an HTTP 500 response it was returning an exit code that meant failure (!= 0), but that seems to be not the case. Is there a way I can I make cURL fail with an ...
0
votes
1answer
373 views

Get errorlevel in cmd script calling ssh

ssh -i private_linux_key user@machine "exit 1" || echo %errorlevel% This always prints 0. How can I get actual error code returned by ssh? || somehow detects that there was an error.
2
votes
4answers
1k views

Accessing an exit code outside of a su -m $USER -c “<cmd>”

The below command prints "0" or "1" correctly depending on failure or not because i put $? inside the "su" command. sudo su -m $USER -c "./shutdown.sh &> /dev/null; echo \$?" However, if i ...
0
votes
1answer
438 views

How do I invert the exit code of a program or pipe within ZSH?

I want to invert the exit code of a piped command sequence: foo | bar within the ZSH. So 0 maps to 1 and 1-128 maps to 0.
2
votes
2answers
2k views

exit code 128, what's the reason?

As per definition exit code 128 means 'invalid exit argument'. But i always get 255 (Exit status out of range) in case argument is invalid like float number. Is this the proprietary implementation ...
12
votes
2answers
2k views

Can I make SSH fail when a port forwarding fails?

If I do a remote port forward, a la -R 3690:localhost:3690 when a binding already exists on the port on the remote host, I get this warning: Warning: remote port forwarding failed for listen port ...
3
votes
1answer
1k views

How to make TaskScheduler fail when the task returns result different from 0

I have a backup task that fails with a non zero result, yet Task Scheduler says that it executed the task correctly. Is there any way to tell Task Scheduler that the task failed?
33
votes
6answers
18k views

Getting ROBOCOPY to return a “proper” exit code?

Is it possible to ask ROBOCOPY to exit with an exit code that indicates success or failure? I am using ROBOCOPY as part of my TeamCity build configurations, and having to add a step to just silence ...
1
vote
1answer
533 views

How to check return status of command invoked from command line in windows?

reg import RegFile.reg How to check return code of this command ?