Sponsored Content
Top Forums Shell Programming and Scripting How to Force command substitution evaluation in bash? Post 302969883 by shamrock on Tuesday 29th of March 2016 02:47:54 PM
Old 03-29-2016
I agree with the others in that the answer lies somewhere in your BackupRecords script...
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I perform double substitution in bash?

#!/bin/bash #set -x MAX=255 FILE=$1.dns_list #declare -a d_arr if then echo "Usage: `basename $0` network" echo " e.g.`basename $0` 1.1.1" exit fi echo "Remove file $FILE..." rm $FILE for (( i = 1; i < $MAX; i++ )) do PARSE=$(host $1.${i}) ... (3 Replies)
Discussion started by: flee
3 Replies

2. Shell Programming and Scripting

/bin/bash - variable substitution.

Is it possible with a bash variable to perform multiple substitution strings to one variable? I have this variable: echo $clock TIMEZONE="US/Central" What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries. this is... (6 Replies)
Discussion started by: trey85stang
6 Replies

3. Shell Programming and Scripting

[bash] command line substitution with environmental variables

Hi, I'm using an array that contains compiler FLAGS that need to be executed either before ./configure or after the main 'make' command. example of array containing compiler flags. ------------------------------------------------- FLAGS="CFLAGS=\"-arch x86_64 -g -Os -pipe... (7 Replies)
Discussion started by: ASGR
7 Replies

4. Shell Programming and Scripting

Correct bash substitution

Hello! I'm writing a shell script using #!/bin/bash instead of #!/bin/sh because of the substitution: ${!variable}, which won't work with sh. My main problem is the following (just a summarized example, the script is much more complex): # sourced from a configuration file, we have a lot of... (6 Replies)
Discussion started by: teresaejunior
6 Replies

5. UNIX for Dummies Questions & Answers

cp command evaluation

Hi all! I'm writting one script to copy a file in various folders, but there are 2 things to validate. First that the folder where i'll be cpying exists, and second that i have permissions to copy the file in it. so far i have found the way to validate the folder exists, but when trying to... (6 Replies)
Discussion started by: feliperivera
6 Replies

6. Shell Programming and Scripting

bash, command line substitution

I have one script calling another with a set of strings that includes white space. Script A calls Script B with these input strings: one two "th ree" Script B pulls apart the arguments correctly: arg0 = one, arg1 = two, arg2 = "th ree" if I call it from within Script A like so:... (10 Replies)
Discussion started by: skippyV
10 Replies

7. Shell Programming and Scripting

Bash regex evaluation not workin

I'm building a script that may received start and end date as parameters. I whant to make it as flexible as possible so I'm accepting epoch and date in a way that "date --date=" command may accept. In order to know if parameter provided is an epoc or a "date --date=" string I evaluate if the value... (2 Replies)
Discussion started by: lramirev
2 Replies

8. Shell Programming and Scripting

How to Force command substitution evaluation in bash?

OK, I'm striving to abide by all the rules this time. Here is a fragment of my windows10/cygwin64/bash script: export BUPLOG=$(BackupRecords --log "$src") robocopy $(BackupRecords -mrbd "$src" --path "$src") $(BackupRecords --appSwitches "$src") "$src" "$dst" $(BackupRecords --fileSwitches... (0 Replies)
Discussion started by: siegfried
0 Replies

9. Shell Programming and Scripting

Evaluation of test command

Could somebody please explain to me why and how the highlighted line(s) (?) of code puts the "test" evaluation into "result" and then to $enable_static ? Or does not ? I did comment out the original code and changed it to what I feel is less cryptic , but the "result" is still wrong =... (3 Replies)
Discussion started by: anne
3 Replies
FVWM-THEMES-COM(1)						   Fvwm Utility 						FVWM-THEMES-COM(1)

NAME
fvwm-themes-com - fvwm-themes communication center SYNOPSIS
fvwm-themes-com [ --help] [ --version] [ --name name ] [ --message message ] [ --lock-and-get ] [ --get-buffer ] [ --clear-buffer ] [ --buffer-name name ] [ --line lineNbr] DESCRIPTION
This script is not a user script. It is used by Fvwm-Themes for communication between some FvwmScript scripts and some other programs. Basically, you want to start a programs in the background which support the fvwm-themes-com communication protocol (e.g., fvwm-themes-menu- app and fvwm-themes-config with the com-mode option can be used as generic examples), then you can use fvwm-themes-com to ask questions or to give instructions to the background program. The answer are displayed by fvwm-themes-com in the standard out put and can be used by a FvwmScript script via the GetoutPut instruction. The advantage of using this method is that the background program have to do its main job only once (e.g., parsing a lot of informations and storing them in some variables) and a script can have very fast answer from the back- ground program via fvwm-themes-com. OPTIONS
--help - show the help and exit --version - show the version and exit --name name - the name of the communication (e.g., if you start fvwm-themes-menuapp with --com-name pid option you must use menuapp-pid as name to communicate with it). The pipe used for communication are $FVWM_DATADIR/{.tmp-com-in-name,tmp-com-out-name,tmp-com-lock-name}. The "buffer" file is $FVWM_USERDIR/.tmp-com-buffer-name --message - A one line message to be sent to the back program. --lock-and-get - Wait (a certain "time out") for an answer of the message. Then, the answer is displayed on STDOUT. --line n - n must be an integer n > 0. In the case of a lock and get message, fvwm-themes-com will out put only the nth line of the answer of the back program on STDOUT and will copy the complete answer in a "buffer" file. If you use the get-buffer option the nth line of the buffer is out put on STDOUT. --get-buffer - Out put the buffer file on STDOUT. --buffer-name othername - Use an alternative name for the buffer file: $FVWM_USERDIR/.tmp-com-buffer-othername. This is usefull if two pro- grams use the same background program and both use the buffer. --clear-buffer - remove the buffer file. USAGE
Here an example: In the Script FvwmScript-Menus you first start the background program, here fvwm-themes-menuapp, and you set some variables for an easy use of fvwm-themes-com: # found the FvwmScript pid Set $CMD = {perl -e '$t=getppid; print $t . " "'} Set $PID = (GetOutput $CMD 1 -1) # Run fvwm-themes-menuapp until the end of the script Do {Exec fvwm-themes-menuapp --com-mode --com-name=menuapp-}$PID{ &} # to send fvwm-themes-com command Set $SendMsgAndGet = {fvwm-themes-com --name menuapp-}$PID{ --lock-and-get --message=} Set $SendMsg = {fvwm-themes-com --name menuapp-}$PID{ --message=} Set $GetLine = {fvwm-themes-com --name menuapp-}$PID{ --get-buffer --line=} Then in the Script you can ask fvwm-themes-menuapp for some informations: # Get the menu list Set $CMD = $SendMsgAndGet{"menu-items }$MENU{"} Set $ItemsList = (GetOutput $CMD 1 -1) ChangeTitle 11 $ItemsList You can also just send an instruction to fvwm-themes-menuapp: Set $CMD = $SendMsg{"exit"} Do {Exec }$CMD Of course your back program have to support the fvwm-themes-com protocol. See fvwm-themes-menuapp and fvwm-themes-config for examples (com- mode option). See also FvwmScript-Menus and FvwmScript-ThemesCenter. AUTHORS
Olivier Chapuis <olivier.chapuis@free.fr>, 5 May 2000. COPYING
The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. BUGS
Report bugs to fvwm-themes-devel@lists.sourceforge.net 3rd Berkeley Distribution perl v5.6.0 FVWM-THEMES-COM(1)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy