Sponsored Content
Top Forums Shell Programming and Scripting script to insert variable file into another, bit like C's #include Post 302445109 by cvq on Friday 13th of August 2010 08:07:49 PM
Old 08-13-2010
Thank you, yes I am trying to do what Corona688 describes.

I was hoping to keep the <!-- #include file="file2" --> syntax if possible, because I am writing a website using Server Side Includes and this is the syntax for that, but I'm developing the site on a local machine (which won't do SSI) so want to mimic the effect with a script.

If I can't keep the SSI syntax I will try the php thing. Would then need to replace a large number of include lines before uploading to the server... is that any easier than the original problem? Hmmm.
 

10 More Discussions You Might Find Interesting

1. Programming

Writing both 8-bit and 16-bit data to a file

I'm writing both 8-bit and wide 16-bit data to the screen and an output file. I have no problems with writing out to the screen - for example: cout<<8-bit data; wcout<<16-bit data; Similarly, I have used ofstream for 8-bit and wofstream for 16-bit, for example: ofstream out; wofstream wout;... (1 Reply)
Discussion started by: Breen
1 Replies

2. Shell Programming and Scripting

how to include header file in b-sh script

I'm new in this. In C/C++, you define variables in one header file & then simply include it in any files where those variables are referenced. I tried to include a header named DefineVars- which initializes all the globals- but when I add the line "DefineGlobals" at the begining of another... (2 Replies)
Discussion started by: bluemoon1
2 Replies

3. Shell Programming and Scripting

insert a variable in the last column of a file

i want to insert a variable in the last column of a file, the columns are separated by "|". I want to insert the variable in everyline of the file . (7 Replies)
Discussion started by: dineshr85
7 Replies

4. Shell Programming and Scripting

insert line into file using variable

Hi all, I am trying to insert couple of lines before first occurance of line3 which occuring after line 5. So I identified the line 5 line number in the file. Also redirected the all line3 line number to out.txt. Now I have problem in inserting the line using the variable $rep. Please help me... (2 Replies)
Discussion started by: aimmanuel
2 Replies

5. Shell Programming and Scripting

Insert text into file depending on variable

Hey guys , i have a variable with the contents ... NUMBER=4 and a test file with the contents 1248 1213 1214 1278 1200 3045 3444 2130 I want to execute a script that will produce the following output ( based on NUMBER=4) to be ... create 1248 (1 Reply)
Discussion started by: theshams
1 Replies

6. Shell Programming and Scripting

script to include filename with variations at the beginning of the file

Hi there, I have a bunch of files that I want to modify. As a beginner, but nevertheless enthusiast, in the use of the shell I want to create a script enabling me to modify those files quickly. I had only some partial success with various peaces of scripts but I would like to create one script... (1 Reply)
Discussion started by: iamzesh
1 Replies

7. Shell Programming and Scripting

How to insert variable date (monthly) from SQL script

Hi Guys, Can someone please help me on adding/inserting a variable to an sql scipt? Basically I want to generate data on monthly (i.e. July 01, 2011 to July 31, 2011) basis. As shown below.. set head off; set linesize 300; set pagesize 200; spool /opt/oracle/temp/output.txt select... (1 Reply)
Discussion started by: pinpe
1 Replies

8. Shell Programming and Scripting

Insert a variable to a text file after fixed number of lines

Hi, I am new to unix. I need to insert a variable which contains some lines of text into a text file after fixed number of lines.. Please help me on this.. Thanks in Advance, Amrutha (3 Replies)
Discussion started by: amr89
3 Replies

9. Shell Programming and Scripting

Insert value of env variable in xml file

Hello, I have the following variables set in my env echo $MY_XSD_FILE /home/jak/sample.xsd echo $MY_INTERVAL_VALUE 4 I want to insert them between the xml tags in my xml file cat sample.xml ::::::::::::::: ::::::::::::::: <property name="FILE"></property> :::::::::::::::::::::::... (2 Replies)
Discussion started by: jakSun8
2 Replies

10. UNIX for Beginners Questions & Answers

Bash: Insert in a variable a file

hi all i have a problem in the bash shell. i'd like insert in a variable a file for example : i have a file datafine.log in this file there is : 17/JUN/2019 i want to insert the value of datafine.log in a variable. Regards Frncesco edit by bakunin: please use CODE-tags for your data... (2 Replies)
Discussion started by: Francesco_IT
2 Replies
RECON(1)							     LAM TOOLS								  RECON(1)

NAME
recon - Check if LAM can be started. SYNOPSIS
recon [-a] [-b] [-d] [-h] [-v] [-nn] [-np] [-ssi key value] [bhost] OPTIONS
-a Report all host errors. -b Assume local and remote shell are the same. This means that only one remote shell invocation is used to each node. If -b is not used, two remote shell invocations are used to each node. -d Turn on debugging. -h Print the command help menu. -ssi key value Send arguments to various SSI modules. See the "SSI" section, below. -v Be verbose. -nn Don't add "-n" to the remote agent command line -np Do not force the execution of $HOME/.profile on remote hosts DESCRIPTION
In order for LAM to be started on a remote UNIX machine, several requirements have to be fulfilled: 1) The machine must be reachable via the network. 2) The user must be able to remotely execute on the machine with the default remote shell program that was chosen when LAM was config- ured. This is usually rsh(1), but any remote shell program is acceptable (such as ssh(1), etc.). Note that remote host permission must be configured such that the remote shell program will not ask for a password when a command is invoked on remote host. 3) The remote user's shell must have a search path that will locate LAM executables. 4) The remote shell's startup file must not print anything to standard error when invoked non-interactively. If any of these requirements is not met for any machine declared in bhost, LAM will not be able to start. By running recon first, the user will be able to quickly identify and correct problems in the setup that would inhibit LAM from starting. The local machine where recon is invoked must be one of the machines specified in bhost. The bhost file is a LAM boot schema written in the host file syntax. See bhost(5). Instead of the command line, a boot schema can be specified in the LAMBHOST environment variable. Otherwise a default file, bhost.def, is used. LAM seaches for bhost first in the local directory and then in the installation directory under etc/. recon tests each machine defined in bhost by attempting to execute on it the tkill(1) command using its "pretend" option (no action is taken). This test, if successful, indicates that all the requirements listed above are met, and thus LAM can be started on the machine. If the attempt is successful, the next machine is checked. In case the attempt fails, a descriptive error message is displayed and recon stops unless the -a option is used, in which case recon continues checking the remaining machines. If recon takes a long time to finish successfully, this will be a good indication to the user that the LAM system to be started has slow communication links or heavily loaded machines, and it might be preferable to exclude or replace some of the machines in the system. SSI (System Services Interface) The -ssi switch allows the passing of parameters to various SSI modules. LAM's SSI modules are described in detail in lamssi(7). SSI mod- ules have direct impact on MPI programs because they allow tunable parameters to be set at run time (such as which boot device driver to use, what parameters to pass to that driver, etc.). The -ssi switch takes two arguments: key and value. The key argument generally specifies which SSI module will receive the value. For example, the key "boot" is used to select which RPI to be used for starting processes on remote nodes. The value argument is the value that is passed. For example: recon -ssi boot tm Tells LAM to use the "tm" boot module for native launching in PBSPro / OpenPBS environments (the tm boot module does not require a boot schema). recon -ssi boot rsh -ssi rsh_agent "ssh -x" boot_file Tells LAM to use the "rsh" boot module, and tells the rsh module to use "ssh -x" as the specific agent to launch executables on remote nodes. And so on. LAM's boot SSI modules are described in lamssi_boot(7). This page should be consulted for specific actions that are taken by, and how to tweak the run-time behavior of each boot module. The -ssi switch can be used multiple times to specify different key and/or value arguments. If the same key is specified more than once, the values are concatenated with a comma (",") separating them. Note that the -ssi switch is simply a shortcut for setting environment variables. The same effect may be accomplished by setting corre- sponding environment variables before running lamboot. The form of the environment variables that LAM sets are: LAM_MPI_SSI_key=value. Note that the -ssi switch overrides any previously set environment variables. Also note that unknown key arguments are still set as envi- ronment variable -- they are not checked (by lamwipe) for correctness. Illegal or incorrect value arguments may or may not be reported -- it depends on the specific SSI module. Remote Executable Invocation All tweakable aspects of launching executables on remote nodes during recon are discussed in lamssi(7) and lamssi_boot(7). Topics include (but are not limited to): discovery of remote shell, run-time overrides of the agent use to launch remote executables (e.g., rsh and ssh), etc. FILES
laminstalldir/etc/lam-bhost.def default boot schema file, where "laminstalldir" is the directory where LAM/MPI was installed. EXAMPLES
recon -v mynodes Check if LAM can be started on all the UNIX machines described in the boot schema mynodes. Report about important steps as they are done. recon -v -a Check if LAM can be started on all the UNIX machines described in the default boot schema. Report about important steps as they are done. Check all the machines; do not stop after the first error message. SEE ALSO
rsh(1), tkill(1), bhost(5), lamboot(1), lamwipe(1), lam-helpfile(5), lamssi(7), lamssi_boot(7) LAM 7.1.4 July, 2007 RECON(1)
All times are GMT -4. The time now is 12:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy