Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

concat(1t) [opensolaris man page]

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


concat - Join lists together SYNOPSIS
concat ?arg arg ...? _________________________________________________________________ DESCRIPTION
This command joins each of its arguments together with spaces after trimming leading and trailing white-space from each of them. If all the arguments are lists, this has the same effect as concatenating them into a single list. It permits any number of arguments; if no args are supplied, the result is an empty string. EXAMPLES
Although concat will concatenate lists (so the command: concat a b {c d e} {f {g h}} will return "a b c d e f {g h}" as its result), it will also concatenate things that are not lists, and hence the command: concat " a b {c " d " e} f" will return "a b {c d e} f" as its result. Note that the concatenation does not remove spaces from the middle of its arguments, so the command: concat "a b c" { d e f } will return "a b c d e f" (i.e. with three spaces between the a, the b and the c). SEE ALSO
append(1T), eval(1T) KEYWORDS
concatenate, join, lists 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 Tcl 8.3 concat(1T)

Check Out this Related Man Page

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


list - Create a list SYNOPSIS
list ?arg arg ...? _________________________________________________________________ DESCRIPTION
This command returns a list comprised of all the args, or an empty string if no args are specified. Braces and backslashes get added as necessary, so that the lindex command may be used on the result to re-extract the original arguments, and also so that eval may be used to execute the resulting list, with arg1 comprising the command's name and the other args comprising its arguments. List produces slightly different results than concat: concat removes one level of grouping before forming the list, while list works directly from the original arguments. EXAMPLE
The command list a b "c d e " " f {g h}" will return a b {c d e } { f {g h}} while concat with the same arguments will return a b c d e f {g h} SEE ALSO
lappend(1T), lindex(1T), linsert(1T), llength(1T), lrange(1T), lreplace(1T), lsearch(1T), lset(1T), lsort(1T) | KEYWORDS
element, list 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 Tcl list(1T)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting white spaces

How would I delete white spaces in a specified file? Also, I'd like to know what command I would use to take something off a regular expression, and put it onto another. ie. . . . expression1 <take_off> . . . expression2 (put here) . . . Any help would be great, thanks! (10 Replies)
Discussion started by: cary530
10 Replies

2. UNIX for Dummies Questions & Answers

how to concatenate two command in one line and get the display in one screen

Hi, I would like to know , how to concatenate two command in one line and get the display in one screen for eg command 1 : ls -l /data/logs command 2 : ls -l /data/errors output shd be /data/logs /data/errors xx-xx-xx-xx abc.log xx-xx-xx-xx... (9 Replies)
Discussion started by: vasikaran
9 Replies

3. Shell Programming and Scripting

trimming white spaces

I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies

4. Shell Programming and Scripting

concat fields

hi I have a file, I need to concatenate depening on the no of columns i need to concatenate. for example i need to concatenate field1,filed34,field2( no of columns is not always 3, it can be any number of fields) concat.ksh field1 field34 field2 how to achieve this, is there any argv ,argc... (10 Replies)
Discussion started by: markjason
10 Replies

5. Shell Programming and Scripting

concatenate all duplicate line in a file.

Hi All, i have a zip file like the format 794051400123|COM|24|0|BD|R|99.98 794051413727|COM|11|0|BD|R|28.99 794051415622|COM|23|0|BD|R|28.99 883929004676|COM|0|0|BD|R|28.99 794051400123|MOM|62|0|BD|R|99.98 794051413727|MOM|4|0|BD|R|28.99 794051415622|MOM|80|0|BD|R|28.99 ... (30 Replies)
Discussion started by: vaskarbasak
30 Replies

6. Shell Programming and Scripting

How to concat line first and then removing the ^M character

hi Someone can give me some clue or script in writing the below requirement I am having 5 or 10 files of unix files which contain ^M charactes. First we have to find ^M character and concat the line where it has broken and then we have to remove the ^M character from the uxix... (11 Replies)
Discussion started by: vsantoshusa
11 Replies

7. 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

8. Shell Programming and Scripting

How to concatenate this simple line in Unix?

(13 Replies)
Discussion started by: javygonx
13 Replies

9. Shell Programming and Scripting

Problem while concatenating variables in shell script

Hi folks, I am facing problem when I concat variables with the string. Value for 'JDBC_CLASSES' variable looks malformed (/classes12.zip2.0KAGES) But, my expected result for 'JDBC_CLASSES' is /opt/API-R111/PACKAGES/jdbc/ORACLE9.2.0/ Am I missing anything here? My... (10 Replies)
Discussion started by: Adhil
10 Replies

10. Linux

How to remove spaces in the file?

hiii i have a file that contains spaces in the begining of a file till the middle the from there the txt would appear. hw can i remove those spaces and bring the text to the begining portion file1 text starts from here (12 Replies)
Discussion started by: anurupa777
12 Replies

11. Shell Programming and Scripting

How to remove all blank spaces in a file

I have a file which contains data such as that shown below. How do i remove all the blcnak spaces, before, during and at the end of each line in one command? 300015, 58.0823212, 230.424728 300016, 58.2276459, 229.141602 300017, 58.7590027, 226.960846 ... (9 Replies)
Discussion started by: carlr
9 Replies

12. UNIX for Dummies Questions & Answers

Concatenate two columns and separate by - (minus)

hi all could you please help me to concatenate two colomns and separate them by "-" the two colomns to concatenate are colomuns 1 and 3 of a very bif file clomn 1 is chr, 2 is snp and 3 is bp the new colomn is chr_B input file : 1 rs1111 10583 1 rs1891 10611 1 rs1807 ... (13 Replies)
Discussion started by: biopsy
13 Replies

13. UNIX for Dummies Questions & Answers

awk for concatenation of column values

Hello, I have a table as shown below. I want to concatenate values in col2 and col3 based on a value in col4. 1 X Y A 3 Y Z B 4 A W B 5 T W A If col4 is A, then I want to concatenate col3 with itself. Otherwise it should concateneate col2 with col3. 1 X Y YY 3 Y Z YZ... (10 Replies)
Discussion started by: Gussifinknottle
10 Replies

14. Shell Programming and Scripting

Search for an undetermined number of spaces

I would like to find an undetermined number of spaces and shorten them to one space. I am running Debian in mksh. Script running in #!/bin/sh. Sorry to not include all code. The program is too big and involves an online file... too much hassle to solve a simple issue. Ex., I start with... (11 Replies)
Discussion started by: bedtime
11 Replies

15. Shell Programming and Scripting

How to remove leading and trailing spaces for variable in shell script?

Hi I have variable named tablename. The value to tablename variable has leading and trailing white spaces. How to remove the leading and training white spaces and write the value of the tablename without space to a file using shell script. ( for e.g. tablename= yyy ) INPUT ... (10 Replies)
Discussion started by: pottic
10 Replies