LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices



Old

uuidfstab - Convert fstab contents to a format that uses UUID instead of /dev paths.

Posted 09-04-2012 at 10:09 PM by konsolebox
Updated 09-17-2012 at 02:25 AM by konsolebox
Tags bash, fstab, script, uuid

This script helps a user or admin to automatically convert items in fstab so that they would use UUIDs instead.

uuidfstab[.sh]
Code:
#!/bin/bash

function error {
	echo "$1" >&2
	exit 1
}

function show_usage_and_exit {
	error "Usage: $0 <path_to_fstab_file> [<new_fstab_file>]"
}

function process {
	local FSTABFILE=$1 NEWFSTABFILE=$2 LINE DEVICE TEMPFILE ID OUTPUTFILE
...
Senior Member
Posted in Howtos
Views 668 Comments 0 konsolebox is offline
Old

Pseudo-template noob hack that may apply for several situations

Posted 04-12-2012 at 05:10 PM by the dsc (linux-related notes)
Updated 04-12-2012 at 05:14 PM by the dsc

There's a painting software, "mypaint", which is very nice, but it does not support templates, at least not yet.

I've created a template (just a "blank" file with the correct resolution and whatnot) on GIMP, saved it as "ora", but instead of opening this file manually every time, and remembering to save it with a new name in order to not overwrite the template, I came up with a script that will create a new name automatically, with no risk of overwriting...
Member
Posted in Uncategorized
Views 6440 Comments 2 the dsc is offline
Old

PlayShell 0.2-WP10

Posted 04-01-2012 at 04:23 AM by konsolebox

PlayShell 0.2-WP10 was released today.

page: http://playshell.sourceforge.net/
files: http://sourceforge.net/projects/play...hell/0.2-WP10/
Senior Member
Posted in Projects
Views 599 Comments 0 konsolebox is offline
Old

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

Posted 04-01-2012 at 12:54 AM by konsolebox
Updated 07-28-2014 at 12:39 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.

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

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

killtree3 - This version kills...
Senior Member
Posted in Howtos
Views 1969 Comments 0 konsolebox is offline
Old

Handling all file names safely in Bash

Posted 02-11-2012 at 01:09 PM by Nominal Animal
Updated 04-16-2012 at 03:41 AM by Nominal Animal (Fuller fixes.)
Tags bash, filename, nul

In Linux, each file or directory name (or more generally, pathname component) is just a string of bytes. It always ends with the C end-of-string mark, ASCII NUL: a zero. Value 47, ASCII /, is also reserved for use as a separator between pathnames.

Bash can read ASCII NUL separated data using read -d "" variable. It will, however, remove leading and trailing characters that match IFS, and return false (nonzero status) if the input does not have a final NUL. This applies to...
Senior Member
Posted in Uncategorized
Views 1392 Comments 0 Nominal Animal is offline

  



All times are GMT -5. The time now is 07:19 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration