Sponsored Content
Top Forums Shell Programming and Scripting How to Force command substitution evaluation in bash? Post 302971094 by siegfried on Friday 15th of April 2016 02:19:50 PM
Old 04-15-2016
RudiC:
I do use it (BUPLOG) over again and the problem is that each time I use it gets a new time and I get a new log file name. I was hoping that the value of BUPLOG would be frozen in the initial export command and I would get same value every time I use $BUPLOG but this is not the sdfsdf. Remember: all "BackupRecords.exe --log" is doing is returning the current time.
Is there anyway I can force the execution of "BackupRecords.exe --log" to happen only once during the export command?

Thanks
Siegfried
 

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
sysidconfig(1M) 														   sysidconfig(1M)

NAME
sysidconfig - execute system configuration applications, or define set of system configuration applications SYNOPSIS
sysidconfig [-lv] [-a application] [-b basedir] [-r application] Invoked without any options, the sysidconfig program executes a list of applications. An application on this list is referred to as a "sys- tem configuration application." Every application on this list will be passed one command-line argument, -c. This flag will cause the sys- tem configuration application to perform its configuration function. Without options, sysidconfig should only be invoked by startup scripts, which occurs during the initial installation and during a reconfigure reboot. All applications on the list will be executed, if possible. All activity taken by the sysidconfig program is logged in the sysidconfig log file, /var/log/sysidconfig.log. If one or more of the applications on the list are either not present at execution time, are not exe- cutable, or execute but return a failure code upon completion, then that information will be logged as well. Successful completion of the program can be assumed if no error message is present in the log file. Programs are executed sequentially, with only one configuration application active at a time. Executed with the -l, -a, or -r options, the sysidconfig program allows the super-user to list the defined configuration applications, and to add items to or remove items from that list. Running sysidconfig with options is the only way to view or manipulate the list. Only the super-user can execute the sysidconfig program with options. The -b and -v options change the behavior of sysidconfig, and can be used with or without the list manipulation options discussed above. The -b basedir option is used to specify a reference root directory other than the default, /. The -v option duplicates the log file output on stdout. By default, no SPARC based applications exist on this list. However, the based systems are delivered with one application, kdmconfig(1M), on the list. kdmconfig is not delivered on SPARC based systems. This application is an extension of the sysidtool(1M) suite of programs. It is executed during initial installation and during a reconfig- ure reboot, before the window system has been started. Graphical User Interface (GUI) applications will not execute successfully if they are added to the list of configuration applications via sysidconfig -a. This program is referenced, but not fully described, in the sysidtool(1M) manual page. The valid options are: -a application Add the named application to the list of defined applications. When next invoked without arguments, sysidconfig will run this newly added application after all previously defined applications. application must be a fully qualified path name that is not currently on the list of applications to execute. -b basedir Specify an alternate base directory (/ is defined as the default base directory if no other is specified). The specified directory is used as the root directory when adding, listing, removing, or executing configuration applications. The log file where information is recorded is in /var/log, relative to the specified basedir. In the log file, the basedir is not noted. This means, for example, that if the super-user on a diskless client's server executes: sysidconfig -b /export/root/client -a /sbin/someapp then the diskless client client would have /sbin/someapp executed upon reconfigure reboot. The diskless client's log file would note that /sbin/someapp was added, not /export/root/client/sbin/someapp. Note - The root file system of any non-global zones must not be referenced with the -b option. Doing so might damage the global zone's file system, might compromise the security of the global zone, and might damage the non-global zone's file system. See zones(5). -l List defined configuration applications. Applications will be executed one at a time, in the order shown in the list. -r application Remove the named application from the list of defined applications. application must be a fully qualified path name and it must be on the existing list of applications to execute. -v Verbose mode. This option echoes all information sent to the log file to stdout. Such information includes timestamp infor- mation about when the program was executed, the names of applications being executed, and results of those executions. The sysidconfig program will return 0 if it completes successfully. When executed with the -r or -a options, error conditions or warnings will be reported on stderr. If the requested action completes suc- cessfully, an exit code of 0 will be returned. EPERM The program was executed by a user other than the super-user. EINVAL Option -l, -a, or -r was passed and the action could not be completed successfully. /var/log/sysidconfig.log sysidconfig log file See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWadmap | +-----------------------------+-----------------------------+ sys-unconfig(1M), sysidtool(1M), attributes(5) Only kdmconfig(1M) When run without options, a log of the sysidconfig program's activity can be found in /var/log/sysidconfig.log. This file contains a time- stamp log of each program executed, its resulting stderr output, and its exit code. If an application in the list was not found or is not executable, that will also be noted. 6 Apr 2005 sysidconfig(1M)
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy