Sponsored Content
Full Discussion: cat multiple files questions
Top Forums UNIX for Dummies Questions & Answers cat multiple files questions Post 302362067 by pludi on Thursday 15th of October 2009 01:54:40 AM
Old 10-15-2009
You can use double-quotes to tell the shell not to split arguments on whitespaces, but still substitute globs and variables, eg:
Code:
cat "my file.*" > 'my file'

As for verbosity, cat isn't really that telling. You could put another command at the end to tell you that it's done, or you'll have to use some coding:
Code:
[ -f 'my file' ] && rm 'my file'
for file in "my file.*"
do
    echo "Appending ${file}"
    cat "$file" >> 'my file'
done

This User Gave Thanks to pludi For This Post:
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

*BSD slices - multiple questions

Can you have a second primary slice on a second hdd? I know that primary slices are defined in the mbr, but where are all the sub partitions defined at? From the OBSD installation FAQ: What exactly is in the PBR? (0 Replies)
Discussion started by: Derrek
0 Replies

2. UNIX for Dummies Questions & Answers

cat files

Hi, I was a typical Windows guy. Like to do things just by clicking my mouse:cool:. I got a new job now...where they are big on unix. I am trying to wet my fingures now with unix. Haven't taken the dive yet. I am trying to find a solution for this problem. Please help me with some... (4 Replies)
Discussion started by: sandeep78
4 Replies

3. UNIX for Dummies Questions & Answers

Difference between cat , cat > , cat >> and touch !!!

Hi Can anybody tell the difference between Difference between cat , cat > , cat >> and touch command in UNIX? Thanks (6 Replies)
Discussion started by: skyineyes
6 Replies

4. Shell Programming and Scripting

cat certain files in directories to files named after the dir?

Hi all, I have a directory with many subdirectories each named like so: KOG0001, KOG0002, ...KOG9999. Each of these subdirectories contain a variable number two kinds of files (nuc and prot) named like so: Capitella_sp_nuc_hits.fasta (nuc) and Capitella_sp_prot_hits.fasta (prot). The... (2 Replies)
Discussion started by: kmkocot
2 Replies

5. Shell Programming and Scripting

bash: cat multiple files together except first line?

Hopefully the title summarized what I need help with. I have multiple files that I would like to concatenate in bash. ie: cat file1 file2 file3 > bigfile except I do not want to include the first line from each file (). Any help? Thanks. (6 Replies)
Discussion started by: sanimfj
6 Replies

6. UNIX Desktop Questions & Answers

trying to cat multiple pairs of files

I have a number of files in a directory named like this: fooP1, fooN1, fooP2, fooN2 ... fooP(i), fooN(i). I'd like to know how to combine each P and N pair into a single file, foo(i) TIA John Balwit (1 Reply)
Discussion started by: balwit
1 Replies

7. UNIX for Dummies Questions & Answers

CAT multiple files according to file name

I have a folder that contains a number of files with file names as follows: XX.YYYY..ZZZ.2014.001.000000 XX.YYYY..ZZZ.2014.001.000400 XX.YYYY..ZZZ.2014.001.000800 XX.YYYY..ZZZ.2014.001.001200 XX.YYYY..ZZZ.2014.001.001600 ..... XX.YYYY..ZZZ.2014.002.000000 XX.YYYY..ZZZ.2014.002.000400... (8 Replies)
Discussion started by: quakesrus
8 Replies

8. Shell Programming and Scripting

Select answers from multiple questions using shell script

I have a text file in this format Some lines.... Question no: 1 The question? A. Answer 1 B. Answer 2 C. Answer 3 D. Answer 4 Answer:B Some lines.... Question no: 2 The question? (choose 2) (10 Replies)
Discussion started by: zorrox
10 Replies

9. UNIX for Dummies Questions & Answers

Is there any way to cat multiple files and show filenames?

Hi, Is there any way to do a cat * where it shows the name of each file in the process? Similar to what more does below? $ more ?.sql :::::::::::::: 1.sql :::::::::::::: set linesize 200 select db_unique_name, cast( from_tz( cast(... (5 Replies)
Discussion started by: newbie_01
5 Replies

10. UNIX for Beginners Questions & Answers

Merge multiple columns into one using cat

I will like to merge several files using 'cat', but I observe the output is not consistent. the merge begins at the last line of the first file. file1.txt: 1234 1234 1234 file2.txt: aaaa bbbb cccc dddd cat file1.txt file2.txt > file3.txt file3.txt: 1234 1234 1234aaaa bbbb cccc... (13 Replies)
Discussion started by: geomarine
13 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe [ name ... ] DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /bin/cat'' it will create the following two files: -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ /bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that /bin/cat works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), gznew(1), gzmore(1), gzcmp(1), gzforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgzip | +--------------------+-----------------+ |Interface Stability | External | +--------------------+-----------------+ NOTES
Source for gzip is available in the SUNWgzipS package. GZEXE(1)
All times are GMT -4. The time now is 06:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy