1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
/*
* Copyright (c) 2022 Firebuild Inc.
* All rights reserved.
*
* Free for personal use and commercial trial.
* Non-trial commercial use requires licenses available from https://firebuild.com.
* Modification and redistribution are permitted, but commercial use of derivative
* works is subject to the same requirements of this license
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* Performs a system() call.
* The command (to be passed to "sh -c") is taken from the first command line parameter.
* Returns 0 (unless an error occurred), not the command's exit code. */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "need exactly 1 argument\n");
return 1;
}
return system(argv[1]);
}
|