Sponsored Content
Top Forums Shell Programming and Scripting Passing Value from Shell to Perl Post 302143936 by porter on Monday 5th of November 2007 12:30:38 PM
Old 11-05-2007
The four primary ways of inputting some to a program (no matter the language the program is written in)

(a) command line argument, like your file argument

(b) environment variables, typically need to export from a shell script

(c) as stdin, basically the input stream to a program

(d) as a generic file, where the program looks for well-known files.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing variable to perl

I need a non-perl (bash) way to strip the path from a list of "find" results. Below is the perl version which I could use, if I could figure out how to call the script with a variable (like in sh, $1 is the variable passed in ./script variable) $file = "/path/to/file.txt"; # How do I... (2 Replies)
Discussion started by: TheCrunge
2 Replies

2. Shell Programming and Scripting

Need help passing variables in shell script to perl one-liner

I'm writing a script to automate some post-install tasks on RHEL4 servers. I need the following code to insert an 'A' in the middle of a string, then replace the string in a file. I know I can use sed to do this, but I'd like to use perl's in place edit so I don't have to write to a temp file,... (1 Reply)
Discussion started by: Xek
1 Replies

3. Shell Programming and Scripting

Passing a file handler and an array from Perl to Shell Script

Hi there, I am trying to call a shell script from a Perl script. here is the code: @args = ("sh", "someshellprg.sh", "a file handler", "an array"); system(@args) == 0 or die "system @args failed: $?"; in the shell program, I examine if the arguments exits using: if then echo... (5 Replies)
Discussion started by: pinkgladiator
5 Replies

4. Shell Programming and Scripting

passing a hash to another script in perl

I have a script (say script1.sh ) and I am calling a script (say script2.sh) within the script1.sh. Here in script1.sh I have a hash ( say %hash1) and i have to pass this hash to script2.sh. Basically i have to do some processing in Scirpt2.sh based on the hash(key,values). I wanted to know how can... (2 Replies)
Discussion started by: ammu
2 Replies

5. Shell Programming and Scripting

Passing arguments to Perl Function

Hi All, I am trying to pass an argument called "Pricelist" to a Perl function, then the function will open and print out the contents of the file named "Pricelist". But i can't seem to do it using my below code. Can any expert give some advice? #!/usr/local/bin/perl $DATABASE =... (1 Reply)
Discussion started by: Raynon
1 Replies

6. Shell Programming and Scripting

Passing date formats in Perl: i.e. Jul/10/2007 -> 20070710 (yyyymmdd) - Perl

Hi , This script working for fine if pass script-name.sh Jul/10/2007 ,I want to pass 20070710(yyyymmdd) .Please any help it should be appereciated. use Time::Local; my $d = $ARGV; my $t = $ARGV; my $m = ""; @d = split /\//, $d; @t = split /:/, $t; if ( $d eq "Jan" ) { $m = 0 }... (7 Replies)
Discussion started by: akil
7 Replies

7. Shell Programming and Scripting

Passing perl variable to shell command

Can we pass perl variable to shell commands. If yes, please give some example. (2 Replies)
Discussion started by: Anjan1
2 Replies

8. Shell Programming and Scripting

Passing PERL var values to SH Shell Script

Greetings all, If I have a SH script that calls a PERL script in the following way: perl $HOME/scripts/config.properties And in the config.properties PERL file, this Perl script only sets a number of environmental parameters in the following way: #!/usr/bin/perl $VAR1 = ( ... (3 Replies)
Discussion started by: gikyo12
3 Replies

9. Shell Programming and Scripting

Problems passing shell arguments to perl

Semi-newbie, so flame throwers to 'singe-only', please. ;-) I have a large number of (say) .html files, where I'd like to do a recursive in-place search and replace a particular string. The following bit of perl works fine: perl -pi -e 's/oldstring/newstring/g' `find ./ -name *.html` ... (2 Replies)
Discussion started by: johnny_canucl
2 Replies

10. Shell Programming and Scripting

Converting shell to Perl I run into shell built in function trap and need alternative in Perl

I am working on converting shell to Perl script. In shell we have built in function trap Do you know alternative in Perl or actually we don't need it? Thanks for contribution (3 Replies)
Discussion started by: digioleg54
3 Replies
geom(1)                                                                                                                                    geom(1)

NAME
geom - analyzes a molecular geometry input in Cartesian coordinates. DESCRIPTION
The program geom reads a set of Cartesian coordinates and determines from them the bond distances (Bohr and angstrom), bond angles, tor- sional angles, out-of-plane angles (optional), moments of inertia, and rotational constants. FILES REQUIRED
input.dat - Input file and one of the following: geom.dat - geometry file file11.dat - PSI-format geometry/gradient file FILES GENERATED
geom.out - file containing the analysis INPUT OPTIONS
The geom program has the following options: -h Print help information (these options). -aces [filename] Read the input in an ACES output format, with each line consisting of atomic symbol, atomic number, and Cartesian coordinates (in Bohr). The optional argument is the name of the geometry input file, which defaults to geom.dat. -qchem [filename] Read the input in an QCHEM output format, with each line consisting of the atom number, the atomic symbol, and Cartesian coordinates (in Angstroms). The optional argument is the name of the geometry input file, which defaults to geom.dat. -xyz [filename] Read the input in an XYZ output format. The first line contains the number of atoms and the second line is a comment line. Subse- quent lines each contain the atomic symbol and Cartesian X Y and Z coordinates (in Angstroms). The optional argument is the name of the geometry input file, which defaults to geom.dat. -oop Print out-of-plane angles, where the angle a-b-c-d is defined as the angle formed by the vector a-d and the plane defined by atoms b, c, and d. DO_OOP = boolean Same as command-line switch -oop described above. ISOTOPES = matrix of reals/strings Used to specify masses to be used in the calculation of the center of mass and rotational constants. One array is provided for each isotopomer to be calculated. The arrays can mix floating point numbers with strings which designate isotopes. If this array is not given and file11.dat is present, then the masses will be obtained by converting the atomic numbers in file11. If masses are not given by ISOTOPES or by file11, then no mass-related quantities will be calculated. -g [filename] Read Cartesian coordinates from a file other than file11.dat. If a filename is not given, the default is geom.dat. The alternative file is assumed to be in a format similar to that of PSI's geom.dat. Since such files do not contain atomic numbers, the moments of inertia and rotational constants are not calculated if this option is used. READ_GEOM = boolean This option in input.dat tells geom to read the geometry from geom.dat in the PSI geom.dat format. -a Print parameters for all pair distances. PRINT_ALL_DIST = boolean Same as -a flag described above. -d distance Only print parameters involving pairs of atoms which are less than distance bohr apart (default value is 4.0 bohr). PRINT_DISTANCE = value Same as -d flag described above. -angstrom The input coordinates are in angstroms, not bohr. ANGSTROM = boolean If TRUE, the input coordinates are in angstroms instead of bohr. The default is FALSE. The following example is for calculating the geometrical information for water with several different isotopes. The geometry is read from geom.dat rather than from file11.dat. geom: ( read_geom = true isotopes = ( (O H H) (O D D) (O18 1.007825 1.007825) ) ) 5 June, 1998 geom(1)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy