Sponsored Content
Top Forums Shell Programming and Scripting append to same string variable in loop Post 302577397 by Prev on Tuesday 29th of November 2011 02:59:38 AM
Old 11-29-2011
help with navigating index in script

Can anyone please brainstorm and help me ?

I gave up the idea of using string variable as it keeps growing larger with each recursive function the control goes in rather than maintaining a value when control comes back at a given level .i.e.
Code:
stringvar="Maths/geometry/circles/triangles/equilateral-triangles"

I am trying to implement it by using array variable but Cant seem to make head way as of now ?Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search a string and append text after the string

Hi, I have a file like this... <o t="Batch" id="8410" p="/" g="32"> <a n="name"> <v s="DBBA1MM"/> </a> <a n="owner"> <v r="/Administrator"/> </a> <a n="rights"> <v s="95"/> </a> <a n="debugLevel"> <v s="3"/> </a> <a n="avsStoreLoc"> <v... (8 Replies)
Discussion started by: kesu2k
8 Replies

2. Shell Programming and Scripting

Adding string variable dynamically in for loop

Hi, I need to generate the text name dynamically in for loop, ex, VAR_COPY_FILE1= file path 1 VAR_COPY_FILE2= file path 2 VAR_COPY_FILE3= file path 3 for i in 1 2 3 do if then "do some process here" fi done (3 Replies)
Discussion started by: msubash26
3 Replies

3. Shell Programming and Scripting

how to test input variable is a string in a select loop

Okay -- I hope I ask this correctly. I'm working on my little shell script to write vendor names and aliases to files from user input. If a user choose to add to a file, he can do that as well. I'm using a select loop for this function to list all the possible files the user can choose from.... (7 Replies)
Discussion started by: Straitsfan
7 Replies

4. UNIX for Dummies Questions & Answers

Append a string on the next line after a pattern string is found

Right now, my code is: s/Secondary Ins./Secondary Ins.\ 1/g It's adding a 1 as soon as it finds Secondary Ins. Primary Ins.: MEDICARE B DMERC Secondary Ins. 1: CONTINENTAL LIFE INS What I really want to achieve is having a 1 added on the next line that contain "Secondary Ins." It... (4 Replies)
Discussion started by: newbeee
4 Replies

5. Shell Programming and Scripting

append blank spaces at the end of a variable string

Hello, could you please help with this one. I have an input file like this: 123,4567,89000 123456789,9876543,12 and for the output I need strings to be with the fixed length, let's say 15, and if the string is -lt 15 to be populated with blanks at the end until it reach 15, like this: 123 ,4567... (1 Reply)
Discussion started by: apenkov
1 Replies

6. Shell Programming and Scripting

Append a searched string with another string using sed

Hi, I need to replace and append a string in a text if grep is true. For eg: grep ABC test.txt | grep -v '\.$' | awk {'print $4'} | sed "s/ ? How do I replace all instances of "print $4" using sed with another sring? Eg of the string returned will be, lx123 web222 xyz Want to... (8 Replies)
Discussion started by: vchee
8 Replies

7. Shell Programming and Scripting

String variable concatenation through loop problem

Hi Team!! Please can anyone tell me why the following line does not work properly? str3+=$str2 it seems that str3 variable does not keep its value in order to be concatenated in the next iteration! Thus when i print the result of the line above it returns the str2 value What i want to do is to... (8 Replies)
Discussion started by: paladinaeon
8 Replies

8. Shell Programming and Scripting

Find string in file and append new string after

Hi All, I'm trying to insert a string into a file at a specific location. I'd like to add a string after the parent::__construct(); in my file. <?php if (! defined('BASEPATH')) exit('No direct script access allowed'); class MY_Controller extends CI_Controller { function... (6 Replies)
Discussion started by: jjkilpatrick
6 Replies

9. Shell Programming and Scripting

How to pre-append a variable string to each line in a file?

How to pre-append a variable string to each line in a file contains both single and double quotes? The variable string has no quotes in it. thank you very much. :confused: (8 Replies)
Discussion started by: dtdt
8 Replies

10. Shell Programming and Scripting

Append has prefix in while loop

I was using below script to grep one file. I need to append the output using prefix Data of all-Vms-1.txt server-1 frame-1 LUN001 server-2 frame-1 LUN002 Data of all-vm-unix.txt server-1 24 server-2 50 Script used while read -r g h ; do cat all-Vms-1.txt |grep... (5 Replies)
Discussion started by: ranjancom2000
5 Replies
mkgeo_ugrid(1rheolef)						    rheolef-6.1 					     mkgeo_ugrid(1rheolef)

NAME
mkgeo_ugrid -- build an unstructured mesh of a parallelotope, in 1d, 2d or 3d SYNOPSIS
mkgeo_ugrid options [n] EXAMPLE
The following command build a triangle based 2d unstructured mesh of the unit square: mkgeo_ugrid -t 10 > square-10.geo geo -mayavi square-10.geo or in one comand line: mkgeo_ugrid -t 10 | geo -mayavi - DESCRIPTION
This command is usefull when testing programs on simple geometries. Invocation is similar to mkgeo_grid (see mkgeo_grid(1)). It calls gmsh as unstructured mesh generator. It avoid the preparation of an input file for a mesh generator. The optional n argument is an inte- ger that specifies the subdivision in each direction. By default n=10. The mesh files goes on standard output. The command supports all the possible element types: edges, triangles, rectangles, tetraedra, prisms and hexahedra. It supports also mixed 2D with triangles and quadrangles: mkgeo_ugrid -tq 10 | geo -mayavi - and mixed 3D with tetraedra, prisms and/or hjexaedra: mkgeo_ugrid -TP 10 | geo -mayavi - mkgeo_ugrid -PH 10 | geo -mayavi - mkgeo_ugrid -TPH 10 | geo -mayavi - ELEMENT TYPE OPTIONS
-e 1d mesh using edges. -t 2d mesh using triangles. -q 2d mesh using quadrangles. -tq 2d mesh using both triangles and quadrangles. -T 3d mesh using tetraedra. -P 3d mesh using prisms. -H 3d mesh using hexahedra. -TP -PH -TPH 3d mesh using a mixt between tetraedra, prisms and/or hexahedra. THE GEOMETRY
The geometry can be any [a,b] segment, [a,b]x[c,d] rectangle or [a,b]x[c,d]x[f,g] parallelotope. By default a=c=f=0 and b=d=g=1, thus, the unit boxes are considered. For instance, the following command meshes the [-2,2]x[-1.5, 1.5] rectangle: mkgeo_ugrid -t 10 -a -2 -b 2 -c -1.5 -d 1.5 | geo - -a float -b float -c float -d float -f float -g float BOUNDARY DOMAINS
-sides -nosides The boundary sides are representd by domains: left, right, top, bottom,front and back. -boundary -noboundary This option defines a domain named boundary that groups all sides. By default, both sides and the whole boundary are defined as domains: mkgeo_ugrid -t 10 > square.geo geo square.geo mkgeo_ugrid -t 10 -nosides > square.geo geo square.geo mkgeo_ugrid -t 10 -noboundary > square.geo geo square.geo mkgeo_ugrid -t 10 -noboundary -nosides > square.geo geo square.geo REGIONS
-region -noregion The whole domain is splitted into two subdomains: east and west, This option is used for testing computations with subdomains (e.g. transmission problem; see the user manual). mkgeo_ugrid -t 10 -region | geo - CORNERS
-corner -nocorner The corners (four in 2D and eight in 3D) are defined as OD-domains. This could be usefull for some special boundary conditions. mkgeo_ugrid -t 10 -corner | geo - mkgeo_ugrid -T 5 -corner | geo - THE MESH ORDER
-order int The polynomial approximation mesh order, as defined by gmsh. This option enable a possible curved boundary, when applying a suit- able nonlinear transformation to the mesh. Defualt is order=1. OTHERS OPTIONS
-clean clear temporary files (this is the default). -noclean does not clear temporary files. SEE ALSO
mkgeo_grid(1) rheolef-6.1 rheolef-6.1 mkgeo_ugrid(1rheolef)
All times are GMT -4. The time now is 12:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy