Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

append(ntcl) [mojave man page]

append(n)						       Tcl Built-In Commands							 append(n)

__________________________________________________________________________________________________________________________________________________

NAME
append - Append to variable SYNOPSIS
append varName ?value value value ...? _________________________________________________________________ DESCRIPTION
Append all of the value arguments to the current value of variable varName. If varName does not exist, it is given a value equal to the concatenation of all the value arguments. The result of this command is the new value stored in variable varName. This command provides an efficient way to build up long variables incrementally. For example, "append a $b" is much more efficient than "set a $a$b" if $a is long. EXAMPLE
Building a string of comma-separated numbers piecemeal using a loop. set var 0 for {set i 1} {$i<=10} {incr i} { append var "," $i } puts $var # Prints 0,1,2,3,4,5,6,7,8,9,10 SEE ALSO
concat(n), lappend(n) KEYWORDS
append, variable Tcl append(n)

Check Out this Related Man Page

eval(1T)						       Tcl Built-In Commands							  eval(1T)

__________________________________________________________________________________________________________________________________________________

NAME
eval - Evaluate a Tcl script SYNOPSIS
eval arg ?arg ...? _________________________________________________________________ DESCRIPTION
Eval takes one or more arguments, which together comprise a Tcl script containing one or more commands. Eval concatenates all its argu- ments in the same fashion as the concat command, passes the concatenated string to the Tcl interpreter recursively, and returns the result of that evaluation (or any error generated by it). Note that the list command quotes sequences of words in such a way that they are not further expanded by the eval command. EXAMPLE
This procedure acts in a way that is analogous to the lappend command, except it inserts the argument values at the start of the list in the variable: proc lprepend {varName args} { upvar 1 $varName var # Ensure that the variable exists and contains a list lappend var # Now we insert all the arguments in one go set var [eval [list linsert $var 0] $args] } KEYWORDS
concatenate, evaluate, script SEE ALSO
catch(1T), concat(1T), error(1T), list(1T), subst(1T), tclvars(1T) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl eval(1T)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending line/lines with sed

Hi folks, I need to append line or bulk of lines into a file. For example,I have the following section in opmn.xml file: <process-type id="OC4J_RTEadmin_NIR" module-id="OC4J"> <module-data> <category id="start-parameters"> <data... (28 Replies)
Discussion started by: nir_s
28 Replies

2. UNIX for Dummies Questions & Answers

how to append spaces(say 10 spaces) at the end of each line based on the length of th

Hi, I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is. I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies

3. Shell Programming and Scripting

SED or AWK "append line to the previous line"

Hi, How can I remove the line beak in the following case if the line begin with the special char “;”? TEXT Text;text ;text Text;text;text I want to convert the text to: Text;text;text Text;text;text I have already tried to use... (31 Replies)
Discussion started by: research3
31 Replies

4. Shell Programming and Scripting

Script to append text from one file into another

Hello all. I was wondering if it possible to write a bash script that would do the following: I perform molecular modelling calculations and the output files are all text files with various different extensions. For example, I submit the input file "job_name.inp" and when it is done or the... (18 Replies)
Discussion started by: marcozd
18 Replies

5. Shell Programming and Scripting

Match data based on two fields, and append to a line

I need to write a program to do something like a 'vlookup' in excel. I want to match data from file2 based on two fields (where both match) in file1, and for matching lines, add the data from two of the fields from file2 to file1. If anyone knows something in perl or awk that can do this, I'd be... (20 Replies)
Discussion started by: jamessmith01
20 Replies

6. Shell Programming and Scripting

Need to append columns for every run

Hi, I have a requirement where I need to append the runtimes of the jobs for every run. I have some 100 jobname and it will be static in output(1st column) . Everyday I need to run my script to find the runtimes for that day and add the entire 100 runtimes to the right of those 100 jobs(2nd... (19 Replies)
Discussion started by: ajayakunuri
19 Replies

7. Shell Programming and Scripting

Awk/Sed - appending within file

hello all, First time post here. I have searched a bit but could not find an exact answer. I have about a week's experience of Sed and Awk, and am having fun, but am a little stuck. I am reformatting an xml file into json format. I have got this far: {"clients": ...and so on. What I want... (22 Replies)
Discussion started by: singerfc
22 Replies

8. Shell Programming and Scripting

Append string at start of line

Hi, I want to append # at the start of line wherever keyword xyz is found through stream editor? Is it possible? (18 Replies)
Discussion started by: db2cap
18 Replies

9. UNIX for Dummies Questions & Answers

How to append portion of a file content to another file when a certain pattern is matching?

Hi ladies and gentleman.. I have two text file with me. I need to replace one of the file content to another file if one both files have a matching pattern. Example: text1.txt: ABCD 1234567,HELLO_WORLDA,HELLO_WORLDB DCBA 3456789,HELLO_WORLDE,HELLO_WORLDF text2.txt: XXXX,ABCD... (25 Replies)
Discussion started by: bananamen
25 Replies

10. Shell Programming and Scripting

Help with appending random sequence to huge CDR file

Hi, I am in a terrible emergency. I have multiple cdr files with line count >6000. I need to append |0| | | | | | | |random| to end of each line. The random number should never repeat. Please help with a shell script to process all cdr's in a directory with above requirement. (23 Replies)
Discussion started by: shiburnair
23 Replies

11. Shell Programming and Scripting

Appending ErrorCodes to the corresponding error record

Hi, Here i'm using a awk inside bash script to validate the datafile by referring to the configuration file(schema file). Here the validation check is done for datatype, field length and null values. Once the validation is done on data file the error records are moved to the bad file. So... (22 Replies)
Discussion started by: shree11
22 Replies

12. Shell Programming and Scripting

Need comand or script for append text after searching for the desired string

Hi all, i have a generated report in unix in the following command like input.txt 47.85,10 0124,42.35,8 0125,3.5,2 the input file format is fixed I need the my output file with append text as below output.txt 0124 amount:42.35 0125 amount:3.5 0124 count : 8 0125... (34 Replies)
Discussion started by: hemanthsaikumar
34 Replies

13. Programming

Appending a column in xlsx file using Python

Is there a way to append an existing xlsx worksheet to add data from a text file ? I have an excel file for which I need to manipulate the first worksheet based on a text file. I match the text file to the xlsx and write the 'Scores' column in the xlsx sheet and save the workbook. For those ... (43 Replies)
Discussion started by: nans
43 Replies

14. UNIX for Beginners Questions & Answers

Delimiter appending in a data file if we receive a less columns than expected

Required No.of field = 12 Let say you got a “~” delimited input file and this file has 6 input fields and now I want to add 12-5=7 number of “~” into this input file in order to make it 12 fields datafile can have n number of records ex., a~b~c~d~12~r a~b~c~d~12~r a~b~c~d~12~r... (19 Replies)
Discussion started by: LJJ
19 Replies

15. UNIX for Beginners Questions & Answers

Bash to append array value to file before copying

The bash stores each uniqueid in an array and then passes them to %q to get the unique path. That seems to work what I am having trouble with is renaming each .png with the unique value in %q. I thought it was working but upon closer inspection, a .png file is being sent to scp.... but only 1 and... (21 Replies)
Discussion started by: cmccabe
21 Replies