Sponsored Content
Top Forums Shell Programming and Scripting Making 256 files with variables Post 302404398 by mario8eren on Tuesday 16th of March 2010 11:31:41 AM
Old 03-16-2010
Quote:
Originally Posted by ungalnanban

Code:
 var1=Welcome;
 eval >$var1

Hei, it's not exactly what I meant.

I will paste my file here, tho it is quite long. I added X, Y, Z, and M for the numbers I want to change.

Code:
#

Titaan-tetra-isopropksiid

0 1
Ti1
O2    Ti1    1.80
O3    Ti1    1.80    O2    109.00
O4    Ti1    1.80    O2    109.00    O3    120.00
O5    Ti1    1.80    O2    109.00    O4    120.00
C6    O2    1.40    Ti1    145.00    O3    0.00
H7    C6    1.10    O2    109.00    O2    X
C8    C6    1.40    O2    109.00    H7    120.00
H9    C8    1.10    C6    109.00    C6    0.00
H10    C8    1.10    C6    109.00    C6    120.00
H11    C8    1.10    C6    109.00    C6    240.00
C12    C6    1.40    O2    109.00    C8    120.00
H13    C12    1.10    C6    109.00    C6    0.00
H14    C12    1.10    C6    109.00    C6    120.00
H15    C12    1.10    C6    109.00    C6    240.00
C16    O3    1.40    Ti1    145.00    O4    0.00
H17    C16    1.10    O3    109.00    O3    Y
C18    C16    1.40    O3    109.00    H17    120.00
H19    C18    1.10    C16    109.00    C16    0.00
H10    C18    1.10    C16    109.00    C16    120.00
H21    C18    1.10    C16    109.00    C16    240.00
C22    C16    1.40    O2    109.00    C18    120.00
H23    C22    1.10    C16    109.00    C16    0.00
H24    C22    1.10    C16    109.00    C16    120.00
H25    C22    1.10    C16    109.00    C16    240.00
C26    O4    1.40    Ti1    145.00    O5    0.00
H27    C26    1.10    O4    109.00    O4    Z
C28    C26    1.40    O4    109.00    H27    120.00
H29    C28    1.10    C26    109.00    C26    0.00
H30    C28    1.10    C26    109.00    C26    120.00
H31    C28    1.10    C26    109.00    C26    240.00
C32    C26    1.40    O2    109.00    C28    120.00
H33    C32    1.10    C26    109.00    C26    0.00
H34    C32    1.10    C26    109.00    C26    120.00
H35    C32    1.10    C26    109.00    C26    240.00
C36    O5    1.40    Ti1    145.00    O2    0.00
H37    C36    1.10    O5    109.00    O5    M
C38    C36    1.40    O5    109.00    H37    120.00
H39    C38    1.10    C36    109.00    C36    0.00
H40    C38    1.10    C36    109.00    C36    120.00
H41    C38    1.10    C36    109.00    C36    240.00
C42    C36    1.40    O2    109.00    C38    120.00
H43    C42    1.10    C36    109.00    C36    0.00
H44    C42    1.10    C36    109.00    C36    120.00
H45    C42    1.10    C36    109.00    C36    240.00

Each letter (X,Y,Z,M) must be a number (60; 150; 240; 330). So I have 4 places where there could be 4 different numbers. All together I have 4^4 different files I want to have.

I hope it made the question easyer Smilie .

Thank you in advance,

Mario
 

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

pls hlp: making .sh files executable

I've got a file named jdictd.sh containing the following: --- begin file contents --- #! /bin/csh echo I\'m running! java -cp jdictd.jar org.dict.server.JDictd data/dict.ini # Use the following line instead if JRE 1.1 is used # jre -cp jdictd.jar org.dict.server.JDictd data/dict.ini ---end... (2 Replies)
Discussion started by: ropers
2 Replies

2. UNIX for Dummies Questions & Answers

Making files readonly with vi?

Hi, I'm new at this whole Unix thing, but definately learning (lots of fun)... and I was wondering - how do you make a file read-only with vi? I don't mean how do you load up vi in read-only mode, but how do you save a file (or flag a file, or whatever) in vi to read-only? How do you make it... (2 Replies)
Discussion started by: Flyguy
2 Replies

3. Shell Programming and Scripting

Making file with values from different files

Hello, I am stuck up in middle of a script.Pls have a look at the problem and help me in any way out for the same. There are n number of files with n number of contents in a column. for example : file1 has contents in quotes "abcd" "1234-asbcd" "12312"..... file2 has contents in... (4 Replies)
Discussion started by: er_aparna
4 Replies

4. Shell Programming and Scripting

[problem] making a backup files

Hi guys, I'm a little stuck on this problem, I've tried googling it and some trial and error but can't seem to get it working. Basically I need the script to: 1) create a directory called "mybackups", if it doesn't exist 2) go through all the .sh files in the current directory, and copy... (4 Replies)
Discussion started by: chazij
4 Replies

5. Shell Programming and Scripting

Making Variables

Dear Friends, Here I need your help once again. I have a flat file with pipe de-limited format e.g. 12345|1234567890|0|0|0| (Total 5 values) I want to take all non 0 ("Zero") values in variables named as anu1, anu2, anu3, anu4 and anu5. Is it possible? Please guide me. Thank you in... (3 Replies)
Discussion started by: anushree.a
3 Replies

6. Shell Programming and Scripting

[PHP] Need help with making variables Global

I have made a script that requires another php script for functions. I need a way so that the required script can read and write the main script's variables. Best Regards, John Wei ---------- Post updated at 08:54 AM ---------- Previous update was at 08:40 AM ---------- Sorry Guys, EDIT: my... (1 Reply)
Discussion started by: johntzwei
1 Replies

7. UNIX for Advanced & Expert Users

Move files while making a tar

I have the following folder structure code/f1/ code/lib/t1 code/lib/t2 code/lib/t3 code/lib/t3 code/lib_1/t1 code/exc I would like to create a tar with a folder structure below and I can use the following tar command f1 lib/t1 lib/t2 lib/t3 tar -cvf code.tar -C code f1 lib... (4 Replies)
Discussion started by: alpboys
4 Replies

8. Shell Programming and Scripting

Making a script to copy files not seen before (using md5sum)

Hello, I would like to make a script that searches through a SRC folder and copies only files it's never seen before to a DEST folder. SRC = /user/.phonesync/photos-backup DST = /usr/.phonesync/photos-new So basically, I'd start with a: md5sum /user/.phonesync/photos-backup/* >... (29 Replies)
Discussion started by: nbsparks
29 Replies

9. Shell Programming and Scripting

Need script for making files based on some conditions.

Hi All, I have a text file (code_data.txt) with the followig data. AMAR AB123456 XYZ KIRAN CB789 ABC RAJ CS78890 XYZ KAMESH A33535335 ABC KUMAR MD678894 MAT RITESH SR3535355... (26 Replies)
Discussion started by: ROCK_PLSQL
26 Replies
NPM-RUN-SCRIPT(1)                                                                                                                NPM-RUN-SCRIPT(1)

NAME
npm-run-script - Run arbitrary package scripts SYNOPSIS
npm run-script <command> [--silent] [-- <args>...] alias: npm run DESCRIPTION
This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts. As of ` https://blog.npmjs.org/post/98131109725/npm-2-0-0, you can use custom arguments when executing scripts. The special option -- is used by getopt https://goo.gl/KxMmtG to delimit the end of the options. npm will pass all the arguments after the -- directly to your script: npm run test -- --grep="pattern" The arguments will only be passed to the script specified after npm run and not to any pre or post script. The env script is a special built-in command that can be used to list environment variables that will be available to the script at run- time. If an "env" command is defined in your package, it will take precedence over the built-in. In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix. For example, if there is a devDependency on tap in your package, you should write: "scripts": {"test": "tap test/*.js"} instead of "scripts": {"test": "node_modules/.bin/tap test/*.js"} to run your tests. The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the /bin/sh command, on Windows it is the cmd.exe. The actual shell referred to by /bin/sh also depends on the system. As of ` https://github.com/npm/npm/releases/tag/v5.1.0 you can customize the shell with the script-shell configuration. Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run. npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is passed, the directory within which node resides is added to the PATH. If --scripts-prepend-node-path=auto is passed (which has been the default in npm v3), this is only performed when that node executable is not found in the PATH. If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten. You can use the --silent flag to prevent showing npm ERR! output on error. You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain. SEE ALSO
o npm help 7 scripts o npm help test o npm help start o npm help restart o npm help stop o npm help 7 config January 2019 NPM-RUN-SCRIPT(1)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy