Sponsored Content
Top Forums Shell Programming and Scripting Bash 101 - to (do) ; or not to (do) ; ? Post 303022241 by annacreek on Tuesday 28th of August 2018 11:38:37 AM
Old 08-28-2018
Bash 101 - to (do) ; or not to (do) ; ?

I figured this forum needs some laughs , so I am posting this.

And if the answer is - it depends on bash version - do not reply.



This is from "manual"


while CONTROL-COMMAND; do CONSEQUENT-COMMANDS; done

And here is the REAL code - no ";"


Code:
while [ $i -lt 4 ] do xterm & i=$[$i+1] done

 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Daemon 101

I think I have an issue almost like Sammy_T's. I want to make a piece of code run as a daemon. I have some java, along with it 15 classpath's converted to a shell script that I can "runmyjavap". The script is just what I need to run after compiling it: #!/bin/sh java -classpath : ...(from... (3 Replies)
Discussion started by: Miller_K
3 Replies

2. UNIX for Dummies Questions & Answers

Help Me please scripting 101

Hi, I had to pull a handful of account numbers from a file into a table. Now I want to do a basic list from a directory in my program showing me if any files for these customers exist. There are files associated with each client and need to be processed individually. $Paytos = 00153301 00153302... (5 Replies)
Discussion started by: ski
5 Replies

3. Shell Programming and Scripting

Bash 101 - string assigment

I am embarrassed to ask this but I am at the end of my rope. I am trying to assign one (string) variable to another. I do understand that bash variables are "not typed", but still learning usage of {} and spaces in script. I was hoping this syntax would work $variableA =... (6 Replies)
Discussion started by: annacreek
6 Replies
LIBBASH(7)							  libbash Manual							LIBBASH(7)

NAME
libbash -- A bash shared libraries package. DESCRIPTION
libbash is a package that enables bash dynamic-like shared libraries. Actually its a tool for managing bash scripts whose functions you may want to load and use in scripts of your own. It contains a 'dynamic loader' for the shared libraries ( ldbash(1)), a configuration tool (ldbashconfig(8)), and some libraries. Using ldbash(1) you are able to load loadable bash libraries, such as getopts(1) and hashstash(1). A bash shared library that can be loaded using ldbash(1) must answer 4 requirments: 1. It must be installed in $LIBBASH_PREFIX/lib/bash (default is /usr/lib/bash). 2. It must contain a line that begins with '#EXPORT='. That line will contain (after the '=') a list of functions that the library exports. I.e. all the function that will be usable after loading that library will be listed in that line. 3. It must contain a line that begins with '#REQUIRE='. That line will contain (after the '=') a list of bash libraries that are required for our library. I.e. every bash library that is in use in our bash library must be listed there. 4. The library must be listed (For more information, see ldbashconfig(8)). Basic guidelines for writing library of your own: 1. Be aware, that your library will be actually sourced. So, basically, it should contain (i.e define) only functions. 2. Try to declare all variables intended for internal use as local. 3. Global variables and functions that are intended for internal use (i.e are not defined in '#EXPORT=') should begin with: __<library_name>_ For example, internal function myfoosort of hashstash library should be named as __hashstash_myfoosort This helps to avoid conflicts in global name space when using libraries that come from different vendors. 4. See html manual for full version of this guide. AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <ril@ran4.net> SEE ALSO
ldbash(1), ldbashconfig(8), getopts(1), hashstash(1) colors(1) messages(1) urlcoding(1) locks(1) Linux Epoch Linux
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy