Sponsored Content
Top Forums Shell Programming and Scripting multiple files to be attached Post 302594012 by venkatareddy on Monday 30th of January 2012 07:44:36 AM
Old 01-30-2012
Hi,
you can acheive that with the following command
Code:
$ ls *1.txt|zip source -@
  adding: a1.txt (deflated 90%)
  adding:  c1.txt (deflated 25%)
  adding:  d1.txt (deflated 25%)

thanks,
venkat

Last edited by Franklin52; 01-30-2012 at 09:09 AM.. Reason: Please use code tags for code and data samples, thank you
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search files and copy them to a directory with datestamp attached to it

Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it. Iam using following command to search the files find $CA_OUT_PATH/*/ftp_out -type f -mtime -1 but now how to copy these files to some other directory one by one with... (1 Reply)
Discussion started by: sreenusola
1 Replies

2. Shell Programming and Scripting

Need assistance with simple shell script to organize files. [Code attached]

I need some help with this shell script for class. All it does is organize your files. It works, but in the log file, it needs to show the new filepaths of the moved files. Heres my log of my output: Starting to organize... movie2.wmv --> movie3.mov --> movie1.mpg --> song1.mp3 --> ... (3 Replies)
Discussion started by: ryandamartini
3 Replies

3. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

4. Shell Programming and Scripting

How to send mail with multiple files attached?

Hi, I would like to send a mail with multiples files attached. Until now i was doing a "find" and then a "tar" of the text files. As I need to be able to read them on a mobile device such as Blackberry for instance, i would like to send them in one single mail, but without taring them. is... (2 Replies)
Discussion started by: Pierrito
2 Replies

5. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

6. UNIX for Dummies Questions & Answers

Run one script on multiple files and print out multiple files.

How can I run the following command on multiple files and print out the corresponding multiple files. perl script.pl genome.gff 1.txt > 1.gff However, there are multiples files of 1.txt, from 1----100.txt Thank you so much. No duplicate posting! Continue here. (0 Replies)
Discussion started by: grace_shen
0 Replies

7. Shell Programming and Scripting

Run one script on multiple files and print out multiple files.

How can I Run one script on multiple files and print out multiple files. FOR EXAMPLE i want to run script.pl on 100 files named 1.txt ....100.txt under same directory and print out corresponding file 1.gff ....100.gff.THANKS (4 Replies)
Discussion started by: grace_shen
4 Replies

8. Shell Programming and Scripting

Grep strings on multiple files and output to multiple files

Hi All, I want to use egrep on multiple files and the results should be output to multiple files. I am using the below code in my shell script(working in Ksh shell). However with this code I am not attaining the desired results. #!/bin/ksh ( a="/path/file1" b="path/file2" for file in... (4 Replies)
Discussion started by: am24
4 Replies

9. What is on Your Mind?

Inserting Attached Files into a Forum Post

OFF_TOPIC Hey ozsavran, Thanks for the great post and photo attachments. Do you mind to explain to me what steps you took to upload and attach those files? I cannot do it and want to attach files like you did. Thanks! (2 Replies)
Discussion started by: Neo
2 Replies
GZENCODE(3)								 1							       GZENCODE(3)

gzencode - Create a gzip compressed string

SYNOPSIS
string gzencode (string $data, [int $level = -1], [int $encoding_mode = FORCE_GZIP]) DESCRIPTION
This function returns a compressed version of the input $data compatible with the output of the gzip program. For more information on the GZIP file format, see the document: GZIP file format specification version 4.3 (RFC 1952). PARAMETERS
o $data - The data to encode. o $level - The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. If not given, the default com- pression level will be the default compression level of the zlib library. o $encoding_mode - The encoding mode. Can be FORCE_GZIP (the default) or FORCE_DEFLATE. Prior to PHP 5.4.0, using FORCE_DEFLATE results in a stan- dard zlib deflated string (inclusive zlib headers) after a gzip file header but without the trailing crc32 checksum. In PHP 5.4.0 and later, FORCE_DEFLATE generates RFC 1950 compliant output, consisting of a zlib header, the deflated data, and an Adler check- sum. RETURN VALUES
The encoded string, or FALSE if an error occurred. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.4.0 | | | | | | | | | | FORCE_DEFLATE now generates RFC 1950 compliant | | | output. | | | | +--------+---------------------------------------------------+ EXAMPLES
The resulting data contains the appropriate headers and data structure to make a standard .gz file, e.g.: Example #1 Creating a gzip file <?php $data = implode("", file("bigfile.txt")); $gzdata = gzencode($data, 9); $fp = fopen("bigfile.txt.gz", "w"); fwrite($fp, $gzdata); fclose($fp); ?> SEE ALSO
gzdecode(3), gzdeflate(3), gzinflate(3), gzuncompress(3), gzcompress(3), ZLIB Compressed Data Format Specification (RFC 1950) . PHP Documentation Group GZENCODE(3)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy