Sponsored Content
Top Forums Shell Programming and Scripting Compress the contents of a directory while copying data into it Post 302275768 by JerryHone on Monday 12th of January 2009 06:22:46 AM
Old 01-12-2009
How about...
Quote:
for f in *
do
mknod ${f}_pipe p
chmod 777 ${f}_pipe
compress -v < ${f}_pipe > ${f}.Z &
cp -p $f ${f}_pipe
rm ${f}_pipe
done
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to compress a directory on a Sun Solaris 5.7 ?

Hi, Is there any utility to compress an entire directory on a Sun Solaris 5.7 ? Something like "compressdir" on other flavours of Unix ? Thanks (4 Replies)
Discussion started by: sameerdes
4 Replies

2. Shell Programming and Scripting

How to Compress files before moving them in a directory

I need a shell script that zips a file before moving them..please help (3 Replies)
Discussion started by: godalle
3 Replies

3. Shell Programming and Scripting

compress Directory

Hi Friends, I have a directory under which 10 more directories are there. In each 10 directories there are several files. I want to do FTP. But in FTP we cannt Transfer the main directory. each Time we have to go to the respective directry and then we have to to FTP. For this instance I... (9 Replies)
Discussion started by: deep_kol
9 Replies

4. Shell Programming and Scripting

Copying subdirectories of a directory to some other directory and renaming them

Hi, I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory. please... (8 Replies)
Discussion started by: sholay
8 Replies

5. Shell Programming and Scripting

Archive directory script with tar/compress

Hi all I need to write a script that archives all files with a certain date in the filename, to another location. It has to run on a AIX using tar/compress or another standard AIX tool. The directory will have x files, each prefixed with a date like yyyymmdd_desc.csv. I need all to... (7 Replies)
Discussion started by: AIXfrog
7 Replies

6. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

7. Shell Programming and Scripting

compress the data and append into a text file

Following is the code: ------------------------------ a=100 b=200 c=300 touch testfl.txt.gz chmod 664 testfl.txt.gz echo $a|gzip >> "testfl.txt.gz" echo $b|gzip >> "testfl.txt.gz" echo $c|gzip >> "testfl.txt.gz" ------------------------------ There is a requirement as follows. I need... (1 Reply)
Discussion started by: kmanivan82
1 Replies

8. Shell Programming and Scripting

script to compress files in directory that changes its name every day

Hi all I have the following script that should compress a file in a directory: # compress log files older than 2 days find /u01/easydone/DBDUMPS/*.dmp -mtime +2 -exec gzip {} \; BUT the problem is that these files that I want to compress are inside a directory with following format: ... (5 Replies)
Discussion started by: fretagi
5 Replies

9. UNIX for Dummies Questions & Answers

How do I compress all files in a directory?

the problem states "Write a script that compresses all the files in the directory. Make a directory and put some files in it. Also make a sub directory in your directory and put files in it also. Once you have this basic ability to compress all files within a directory, add to your script a menu of... (1 Reply)
Discussion started by: Brittany
1 Replies

10. UNIX for Beginners Questions & Answers

Copying Contents of a file

Hello all. Is there a command to copy the contents of one file into another file as the first line? (1 Reply)
Discussion started by: 2metal4u
1 Replies
mknod(1M)						  System Administration Commands						 mknod(1M)

NAME
mknod - make a special file SYNOPSIS
mknod name b major minor mknod name c major minor mknod name p DESCRIPTION
mknod makes a directory entry for a special file. OPTIONS
The following options are supported: b Create a block-type special file. c Create a character-type special file. p Create a FIFO (named pipe). OPERANDS
The following operands are supported: major The major device number. minor The minor device number; can be either decimal or octal. The assignment of major device numbers is specific to each system. You must be the super-user to use this form of the command. name A special file to be created. USAGE
See largefile(5) for the description of the behavior of mknod when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ftp(1), in.ftpd(1M), mknod(2), symlink(2), attributes(5), largefile(5) NOTES
If mknod(2) is used to create a device, the major and minor device numbers are always interpreted by the kernel running on that machine. With the advent of physical device naming, it would be preferable to create a symbolic link to the physical name of the device (in the /devices subtree) rather than using mknod. SunOS 5.10 16 Sep 1996 mknod(1M)
All times are GMT -4. The time now is 05:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy