Recent Changes - Search:

Softwares

.

BashScripting

Main.BashScripting History

Show minor edits - Show changes to output

December 13, 2012, at 07:05 AM by 15.211.153.77 -
Added lines 1-4:
(:Google1:)
(:Googletxt:)
----
Changed lines 30-34 from:
(:Google1:)
(:Googletxt:)

(:Googlemm:)
to:
Added lines 55-56:
----
(:Googlemm:)
July 05, 2012, at 05:21 AM by 15.219.201.70 -
Added lines 25-29:

(:Google1:)
(:Googletxt:)

(:Googlemm:)
March 17, 2006, at 06:32 PM by 210.18.59.46 -
Added lines 1-48:
Adding the directory to the content of the path variable.

export PATH="$PATH:~/scripts"
Debugging script.

sh script1.sh

bash -x script1.sh

The first line of the script determines the shell to start.
The first two characters of the first line should be #!, then follows the path to the shell that should interpret
the commands that follow.
Blank lines are also considered to be lines, so don't start your script with an empty line.

#!/bin/bash

As noted before, this implies that the Bash executable can be found in /bin
debugger for Bash, available at http://bashdb.sourceforge.net

Activating debugging part of the script and then stopping debugging.

set -x # activate debugging from here
w
set +x # stop debugging from here

Use the command below to identify the process tree with the process id's.

pstree -p

usage: pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ]
[ -G | -U ] [ pid | user]
pstree -V

-a show command line arguments
-c don't compact identical subtrees
-h highlight current process and its ancestors
-H pid highlight process "pid" and its ancestors
-G use VT100 line drawing characters
-l don't truncate long lines
-n sort output by PID
-p show PIDs; implies -c
-u show uid transitions
-U use UTF-8 (Unicode) line drawing characters
-V display version information
pid start at pid, default 1 (init)
user show only trees rooted at processes of that user
Edit - History - Print - Recent Changes - Search
Page last modified on December 13, 2012, at 07:05 AM