BASH, TCSH, etc. open source framework, web application software development | Flex - Adobe The Adobe USA site has been optimized for users within the United States. If you live outside the U.S., we recommend that you visit your local site for the most relevant information, including pricing, promotions, and local events. United States Canada - English Your country selection will be remembered for future visits. You can change this selection at any time using the country selector at the bottom of the page. Le site web américain d'Adobe a été optimisé pour les utilisateurs résidant aux États-Unis. Canada - Français Le pays choisi sera enregistré pour vos prochaines visites. View complete list of countries ›
Linux tip: Bash parameters and parameter expansions The bash shell is available on many Linux® and UNIX® systems today, and is a common default shell on Linux. In this tip you will learn how to handle parameters and options in your bash scripts and how to use the shell's parameter expansions to check or modify parameters. This article focuses on bash, and the examples were all run on Linux systems with bash as the shell. Passed parameters Part of the beauty of functions and shell scripts is the ability to make a single function or script behave differently by passing parameters to it. Inside a function or script, you can refer to the parameters using the bash special variables in Table 1. Note: If you have more than 9 parameters, you cannot use $10 to refer to the tenth one. Now you can define a simple function to do nothing more than tell you how many parameters it has and display them as shown in Listing 1. Listing 1. Shell scripts handle parameters in the same way as functions. Listing 2. [ian@pinguino ~]$ cat testfunc.sh #! Listing 3.
Add-on Developer Hub Linux tip: Bash test and comparison functions The Bash shell is available on many Linux® and UNIX® systems today, and is a common default shell on Linux. Bash includes powerful programming capabilities, including extensive functions for testing file types and attributes, as well as the arithmetic and string comparisons available in most programming languages. Understanding the various tests and knowing that the shell can also interpret some operators as shell metacharacters is an important step to becoming a power shell user. This article, excerpted from the developerWorks tutorial LPI exam 102 prep: Shells, scripting, programming, and compiling, shows you how to understand and use the test and comparison operations of the Bash shell. This tip explains the shell test and comparison functions and shows you how to add programming capability to the shell. Tests In any programming language, after you learn how to assign values to variables and pass parameters, you need to test those values and parameters. test and [ Listing 1. (( and [[
Properties - The Python Saga - Part 3 Properties come out of a tired programming language genesis. In the beginning, there were structs. The trouble with structs was that an opaque data structure could not programmatically monitor or intercept access and mutation of its member data. So that's not a big deal; we could solve the problem with classes. The best practice to avoid programming yourself into a corner was to never expose a datum; you would write accessor and mutator functions, whether you needed them at the moment or not. The idea of managed properties came along eventually in various languages (Python, C#, some implementations of JavaScript, and recent versions of [C]). Lets observe this design shift in Python. class Foo(object): def __init__(self); self.bar = 10 Here's some other fellow's code that uses your class: foo = Foo() foo.bar = 20 print foo.bar del foo.bar So there you have it. Now we have a Foo class that transparently maintains the invariant that "bar" will always be half of "baz".
System Administration Toolkit: Build intelligent, unattended scripts System Administration Toolkit Martin BrownPublished on July 03, 2007 About this series The typical UNIX® administrator has a key range of utilities, tricks, and systems he or she uses regularly to aid in the process of administration. There are key utilities, command-line chains, and scripts that are used to simplify different processes. Some of these tools come with the operating system, but a majority of the tricks come through years of experience and a desire to ease the system administrator's life. The unattended script problem There are many issues around executing unattended scripts—that is, scripts that you run either automatically through a service like cron or at commands. The default mode of cron and at commands, for example, is for the output of the script to be captured and then emailed to the user that ran the script. Setting up the environment Before getting into the uses of unattended scripts, you need to make sure that you have set up your environment properly. Listing 1.
Joe's Blog: An intro to modern OpenGL. Chapter 1: The Graphics Pipeline An intro to modern OpenGL. Chapter 1: The Graphics Pipeline updated April 5, 2010 17:12:05 PDT Table of Contents | Chapter 2 » OpenGL has been around a long time, and from reading all the accumulated layers of documentation out there on the Internet, it's not always clear what parts are historic and what parts are still useful and supported on modern graphics hardware. Update: Join the Reddit discussion. What is OpenGL? Another recent development has been the adoption of general purpose GPU (GPGPU) libraries, including nVidia's CUDA and Khronos' OpenCL. For these tutorials, I'm going to assume you're already a programmer and that you know C, but that you haven't necessarily seen OpenGL or done graphics programming before. Where do I get OpenGL, GLUT, and GLEW? OpenGL comes standard in some form or another on MacOS X, Windows, and most Linux distributions. To install GLUT and GLEW, look for the binary packages on their respective sites. The graphics pipeline The vertex and element arrays
Power Shell Usage: Bash Tips & Tricks Bash Tips & Tricks Simon Myers UKUUG Linux 2003 Conference • August 2003 This view lists all the slides from the talk in a continuous format. The slides are also designed to be viewed as a slideshow from this file with Mozilla or a compatible browser. 1 Intro Tips for driving Bash better in everyday Linux use Target audience: people who type things in Linux Assumptions: You suspect Bash has features useful to you You know that bash(1) is looong You’re too lazy to read it 2 Not a List of Keystrokes More interesting tips than just listing keystrokes This talk not about: Ctrl+W, Meta+BkSpc, Meta+D, Ctrl+K, Ctrl+U, Meta+F, Meta+B, Shift+Ins, Ctrl+T, Ctrl+], Ctrl+Meta+] If you want to learn keystrokes, look them up 3 History Command history means never having to retype previous commands In theory Default configuration makes this not always the practice Problems: Sometimes commands don’t seem to get saved It can be awkward to find those that have been 4 The ‘New Window’ Problem 6 ‘Loser Takes All’