Sponsored Content
Top Forums Shell Programming and Scripting Real-time scenarios where VARIABLE SUBSTITUTION/EXPANSION is useful Post 302946280 by bakunin on Sunday 7th of June 2015 04:37:12 AM
Old 06-07-2015
MadeInGermany, you are right. You are right too in pointing out that ":-" is perhaps more common than ":=". I just used this as - one - example out of a millions applications for parameter expansion in general because the threads o/p has mentioned it explicitly in his post #1.

I didn't undergo too much effort in explaining what a specific expansion could be used for because - see the first part of my answer - i think what sets apart programmers from the non-programmers is the ability to look at a certain language feature (or function, tool, ...) and come up with an idea of its useful application. People who see a certain stone and do not envision a sculpture IMHO do not have what it takes to be a sculptor either.

bakunin
These 3 Users Gave Thanks to bakunin For This Post:
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed insert command and variable expansion/command substitution

I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename? #!/bin/bash filename=`echo $0` /usr/bin/sed '/#include/ { i\ the filename is `$filename` }' $1 exit 0 (8 Replies)
Discussion started by: glev2005
8 Replies

2. Shell Programming and Scripting

[Solved] Command Substitution and Variable Expansion within a Case

Hello All, I don't write scripts very often, and in this case I am stumped, although it may be a bug in the version of bash I have to use (it's not my system). I want to extract a specific string snippet from a block of text (coming from a log file) that is dependent on a bunch of other... (1 Reply)
Discussion started by: jaimielives
1 Replies

3. Shell Programming and Scripting

Shell script to convert epoch time to real time

Dear experts, I have an epoch time input file such as : - 1302451209564 1302483698948 1302485231072 1302490805383 1302519244700 1302492787481 1302505299145 1302506557022 1302532112140 1302501033105 1302511536485 1302512669550 I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies

4. Shell Programming and Scripting

Converting real time to epoch time

# date +%s -d "Mon Feb 11 02:26:04" 1360567564 # perl -e 'print scalar localtime(1360567564), "\n";' Mon Feb 11 02:26:04 2013 the epoch conversion is working fine. but one of my application needs 13 digit epoch time as input 1359453135154 rather than 10 digit epoch time 1360567564... (3 Replies)
Discussion started by: vivek d r
3 Replies

5. Shell Programming and Scripting

sed variable expansion fails for substitution in range

I'm trying to change "F" to "G" in lines after the first one: 'FUE.SER' 5 1 1 F0501 F0401 F0502 2 1 F0301 E0501 F0201 E0502 F0302 3 1 F0503 E0503 E0301 E0201 E0302 E0504 F0504 4 1 F0402 F0202 E0202 F0101 E0203 F0203 F0403 5 1 F0505 E0505 E0303 E0204 E0304 E0506... (10 Replies)
Discussion started by: larrl
10 Replies
RECOLLINDEX(1)						      General Commands Manual						    RECOLLINDEX(1)

NAME
recollindex - indexing command for the Recoll full text search system SYNOPSIS
recollindex -h recollindex [ -c <configdir> ] [ -z ] [ -m ] [ -w <seconds> ] [ -D ] [ -x ] recollindex [ -c <configdir> ] -i [ -f ] [<filename [filename ...]>] recollindex [ -c <configdir> ] -e [<filename [filename ...]>] recollindex [ -c <configdir> ] -l recollindex [ -c <configdir> ] -s <lang> recollindex [ -c <configdir> ] -S DESCRIPTION
The recollindex utility allows you to perform indexing operations for the Recoll text search system. The -c option specifies the configuration directory name, overriding the default or $RECOLL_CONFDIR. There are several modes of operation. The normal mode will index the set of files described in the configuration file recoll.conf. This will incrementally update the database with files that changed since the last run. If option -z is given, the database will be erased before starting. If option -m is given, recollindex is started for real time monitoring, using the file system monitoring package it was configured for (either fam, gamin, or inotify). This mode must have been explicitly configured when building the package, it is not available by default. The program will normally detach from the controlling terminal and become a daemon. If option -D is given, it will stay in the foreground. Option -w <seconds> can be used to specify that the program should sleep for the specified time before indexing begins. The default value is 60. The daemon normally monitors the X11 session and exits when it is reset. Option -x disables this X11 session monitoring (daemon will stay alive even if it cannot connect to the X11 server). You need to use this too if you use the daemon without an X11 context. recollindex -l will list the names of available language stemmers. recollindex -i will index individual files into the database. The stem expansion and aspell databases will not be updated. The skippedPaths and skippedNames configuration variables will be used, so that some files may be skipped. You can tell recollindex to ignore skippedPaths and skippedNames by setting the -f option. This allows fully custom file selection for a given subtree, for which you would add the top directory to skippedPaths, and use any custom tool to generate the file list (ie: a tool from a source code control system). recollindex -e will erase data for individual files from the database. The stem expansion databases will not be updated. With options -i or -e , if no file names are given on the command line, they will be read from stdin, so that you could for example run: find /path/to/dir -print | recollindex -e followed by find /path/to/dir -print | recollindex -i to force the reindexing of a directory tree (which has to exist inside the file system area defined by topdirs in recoll.conf). recollindex -s will build the stem expansion database for a given language, which may or may not be part of the list in the configuration file. If the language is not part of the configuration, the stem expansion database will be deleted at the end of the next normal indexing run. You can get the list of stemmer names from the recollindex -l command. Note that this is mostly for experimental use, the normal way to add a stemming language is to set it in the configuration, either by editing "recoll.conf" or by using the GUI indexing configuration dialog. At the time of this writing, the following languages are recognized (out of Xapian's stem.h): o danish o dutch o english Martin Porter's 2002 revision of his stemmer o english_lovins Lovin's stemmer o english_porter Porter's stemmer as described in his 1980 paper o finnish o french o german o italian o norwegian o portuguese o russian o spanish o swedish recollindex -S will rebuild the phonetic/orthographic index. This feature uses the aspell package, which must be installed on the system. SEE ALSO
recoll(1) recoll.conf(5) 8 January 2006 RECOLLINDEX(1)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy