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 :: free dock for linux 
Shell :: python zlib 
Shell :: linux split file by lines 
Shell :: install gulp gulp-util exited with code 1 
Shell :: Failed to install expo package with error: yarnpkg exited with non-zero code: 1 yarnpkg exited with non-zero code: 1 
Shell :: git undo all changes 
Shell :: parrot os postman download 
Shell :: minikube insecure registry 
Shell :: open command linux 
Shell :: how to clear a file without deleting it linux 
Shell :: upload transfer.sh 
Shell :: can not login kali linux 
Shell :: Install the postgres CLI tools 
Shell :: how to install raspap 
Shell :: how to commit files in github 
Shell :: brew Cannot install on Intel processor in ARM default prefix (/opt/homebrew)! 
Shell :: create a branch from old commit 
Shell :: run url in pip 
Shell :: find index of string in bash 
Shell :: stash with name 
Shell :: rmdir recursive 
Shell :: docker stop swarm 
Shell :: what is echo in a batch file 
Shell :: how to access the local machine using WSL 
Shell :: mount is fstab 
Shell :: restart service linux crontab 
Shell :: laravel github 
Shell :: powershell command line variables 
Shell :: move multiple files cmd 
Shell :: git the history 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =