Sponsored Content
Top Forums Shell Programming and Scripting How to Force command substitution evaluation in bash? Post 302969894 by Don Cragun on Tuesday 29th of March 2016 04:16:54 PM
Old 03-29-2016
Quote:
Originally Posted by shamrock
Set BUPLOG to be readonly by doing typeset -x -r BUPLOG=$(BackupRecords --log "$src")so the script will throw an error every time it's changed...
We have seen the script. There is nothing in it that changes BUPLOG after it is initially set. As I have said before, BUPLOG must be a string something like:
Code:
BackupLog$(date +'%Y%m%d%H%M%S')

so when $BUPLOG is expanded it yields a value based on the current time; not the time when BackupRecords --log was executed at the start of the 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
BACKUPLOG(5)							AFS File Reference						      BACKUPLOG(5)

NAME
       BackupLog - Traces Backup Server operations

DESCRIPTION
       The BackupLog file records a trace of Backup Server (buserver process) operations on the local machine and describes any error conditions
       it encounters.

       If the BackupLog file does not already exist in the /var/log/openafs directory when the Backup Server starts, the server process creates it
       and writes initial start-up messages to it. If there is an existing file, the Backup Server renames it to BackupLog.old, overwriting the
       existing BackupLog.old file if it exists.

       The file is in ASCII format. Administrators listed in the /etc/openafs/server/UserList file can use the bos getlog command to display its
       contents. Alternatively, log on to the machine and use a text editor or a file display command such as the UNIX cat command. By default,
       the mode bits on the BackupLog file grant the required "r" (read) permission to all users.

       The Backup Server records operations only as it completes them, and so cannot recover from failures by reviewing the file. The log contents
       are useful for administrative evaluation of process failures and other problems.

SEE ALSO
       UserList(5), bos_getlog(8), buserver(8)

COPYRIGHT
       IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

       This documentation is covered by the IBM Public License Version 1.0.  It was converted from HTML to POD by software written by Chas
       Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.

OpenAFS 							    2012-03-26							      BACKUPLOG(5)
All times are GMT -4. The time now is 10:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy