LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Bash functions to list and kill or send signals to process trees

Posted 03-31-2012 at 11:54 PM by konsolebox
Updated 05-27-2018 at 03:11 PM by konsolebox

These functions can be used in scripts or interactive shells to manipulate process trees. At least bash version 3.0 is needed. May also work with some earlier versions.

kill_tree - Creates a list of processes based from a parent process ID first then sends the signal to all of them synchronously.

kill_tree_2 - Same as killtree but it doesn't create a list first. It immediately kills processes as it goes through every level.

kill_tree_3 - This version...
Senior Member
Posted in Howtos
Views 4306 Comments 0 konsolebox is offline
Old

Getting Absolute Paths of UNIX Directories and Filenames in Shell Scripts

Posted 07-08-2011 at 03:05 AM by konsolebox
Updated 05-27-2018 at 03:20 PM by konsolebox
Tags bash, ksh, script, shell, zsh

This post is a compilation of the function getabspath() for different shells that can be used to get the absolute form of a path. The function accepts an argument path then returns the absolute form of it to the variable $__.

Bash
Code:
function getabspath {
	local t=() i=0 IFS=/

	case $1 in
	/*)
		__=${1#/}
		;;
	*)
		__=${PWD#/}/$1
		;;
	esac

	case $- in
	*f*)
		set -- $__
...
Senior Member
Posted in Howtos
Views 4294 Comments 0 konsolebox is offline
Old

Shell Script Loader's First Stable Versions

Posted 04-09-2011 at 04:09 AM by konsolebox
Updated 07-08-2011 at 02:50 AM by konsolebox

After almost 2 years of trying to perfect and refine this software, it's now finally reached the first presentable and stable form. Maybe it's already the final form I'm not sure. I'm glad that I was able to finish it.

versions released: 0.1 (base) and 0X.1 (extended)

homepage: http://loader.sourceforge.net/
project's summary page in sourceforge: http://sourceforge.net/projects/loader
Senior Member
Posted in Projects
Views 935 Comments 0 konsolebox is offline

  



All times are GMT -5. The time now is 01:18 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration