background preloader

Karolina project

Facebook Twitter

Appendix C. Dependencies. Every package built in LFS relies on one or more other packages in order to build and install properly. Some packages even participate in circular dependencies, that is, the first package depends on the second which in turn depends on the first. Because of these dependencies, the order in which packages are built in LFS is very important. The purpose of this page is to document the dependencies of each package built in LFS. For each package we build, we have listed three, and sometimes four, types of dependencies. The first lists what other packages need to be available in order to compile and install the package in question.

The second lists what packages, in addition to those on the first list, need to be available in order to run the testsuites. The last list of dependencies are optional packages that are not addressed in LFS, but could be useful to the user. Autoconf Installation depends on: Bash, Coreutils, Grep, M4, Make, Perl, Sed, and Texinfo Must be installed before: Automake Bash.

Jay's IT blog » Bash: How to check if your script is already running. Sometimes, you don’t want a script to run when it is already running. Maybe it is scheduled as a cronjob but the previous run of that cronjob hasn’t finished yet. I usually do some “pre-flight checks” in almost every script I write. And most times, this is one of them. Here’s how: #! It’s that easy. If [[ "`pidof -x $(basename $0) -o %PPID`" ]]; then exit; fi pidof (program name here)returns the process ID(s) of every running instance of the specified program. One more thing: You must call your scripts directly, like . How do you append to file in python. 10.1. os.path — Common pathname manipulations — Python v2.7.5 documentation. This module implements some useful functions on pathnames. To read or write files see open(), and for accessing the filesystem see the os module.

Note On Windows, many of these functions do not properly support UNC pathnames. splitunc() and ismount() do handle them correctly. Unlike a unix shell, Python does not do any automatic path expansions. Functions such as expanduser() and expandvars() can be invoked explicitly when an application desires shell-like path expansion. (See also the glob module.) Since different operating systems have different path name conventions, there are several versions of this module in the standard library. Posixpath for UNIX-style pathsntpath for Windows pathsmacpath for old-style MacOS pathsos2emxpath for OS/2 EMX paths os.path.abspath(path) Return a normalized absolutized version of the pathname path. Os.path.basename(path) Return the base name of pathname path. Os.path.commonprefix(list) os.path.dirname(path) Return the directory name of pathname path. The os.path module. This module contains functions that deal with long filenames (path names) in various ways.

To use this module, import the os module, and access this module as os.path. Working with file names This module contains a number of functions that deal with long filenames in a platform independent way. In other words, without having to deal with forward and backward slashes, colons, and whatnot. Example: Using the os.path module to handle filename # File: os-path-example-1.py import os filename = "my/little/pony" print "using", os.name, "... " print "split", "=>", os.path.split(filename) print "splitext", "=>", os.path.splitext(filename) print "dirname", "=>", os.path.dirname(filename) print "basename", "=>", os.path.basename(filename) print "join", "=>", os.path.join(os.path.dirname(filename), os.path.basename(filename)) using nt ... split => ('my/little', 'pony') splitext => ('my/little/pony', '') dirname => my/little basename => pony join => my/little\pony /home/effbot/.pythonrc . . .

[Tutor] Creating a list of lists. How To Fill List With User Input? - Python. Scripting, Part Two: Looping for Fun and Profit. Crafty System Administrators who want to conserve energy need to learn the fine art of looping. You energy-conserving* system administrators will enjoy learning to use loops in your scripts. Looping is a technique that allows you to repeat a process or set of commands indefintely or until the loop exhausts a particular list of items. For example, you want to copy a particular file to everyone’s home directory. How do you do it? Don’t worry if you aren’t a scripting master, I’m going to take it slow through this series so that you can absorb what’s going on. The Basics You need access to a Linux system and last week’s post, “Scripting, Part One”.

The Lively Loop There’s nothing particularly special about a loop. My original example is a good one. First, look at what’s needed to make this happen: a list of users, the file in question, and, depending on the file’s purpose, an optional permissions change. Next, put your needs into Linux terms. . #! Khess nimbus bob matthew mark luke john #! #! Python for Bash scripters: A well-kept secret. How To: Python Read A Text File.