Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

exit status bash

echo $? # to print last command exit status
Comment

To set the exit status of a shell script


#!/bin/sh
if cp "$1" "$1.bak"
then
    vi "$1"
    exit   # USE STATUS FROM vi
else
    echo "bkedit quitting: can't make backup?" 1>&2
    exit 1
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: git pull branch you are not on 
Shell :: install flutter 
Shell :: launch sublime from terminal 
Shell :: git lfs all files in folder 
Shell :: fetch a specific branch 
Shell :: linux command to copy file 
Shell :: write a script to shutdown at a time in linux 
Shell :: Bash echo to standard output from function 
Shell :: github color 
Shell :: write in a file linux 
Shell :: is it possible to check with my website if an app is installed? 
Shell :: mac m1 linux install 
Shell :: ubuntu fix wrong lsb_release 
Shell :: libqt5core5a is not installed. 
Shell :: kubectl jq json pod name 
Shell :: installing kubernetes on ubuntu 20.04 
Shell :: libsound2-dev missing 
Shell :: bash cake command not found 
Shell :: strstr bash 
Shell :: where to find project ip adress oon jenkins 
Shell :: ssh with key linux 
Shell :: how to open ssh on port 22 manjaro 
Shell :: managed mode linux kali 
Shell :: git setup upstream 
Shell :: how to set the push.default 
Shell :: stop master git 
Shell :: git clone directory from repository 
Shell :: git find largest files in repo 
Shell :: unzip a zip file ubuntu 
Shell :: extract tar.zst zst linux ubnutu 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =