Sponsored Content
Top Forums Shell Programming and Scripting Insert file names when concatenate files into a file Post 302323194 by samky2005 on Friday 5th of June 2009 04:51:32 PM
Old 06-05-2009
Question Insert file names when concatenate files into a file

Hi

I found the following line would concatenate all test_01 test_02 test_03 files into "bigfile".

cat test_* >> bigfile

But, what I'm looking for a way to insert each file names in order when concatenated in "bigfile".

Thank you
samky2005
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenate files to one file with naming convention

Hi , i have below files in wrk folder. file names are 1102090001.CLT 1102090003.CLT 1102100019.CLT 1102100020.CLT the above files are concatenate to one file but that concatenate file name must be same naming convention. (date +%y%m%d)and 0001 count. example : concatenate file... (9 Replies)
Discussion started by: krbala1985
9 Replies

2. Shell Programming and Scripting

How to split a data file into separate files with the file names depending upon a column's value?

Hi, I have a data file xyz.dat similar to the one given below, 2345|98|809||x|969|0 2345|98|809||y|0|537 2345|97|809||x|544|0 2345|97|809||y|0|651 9685|98|809||x|321|0 9685|98|809||y|0|357 9685|98|709||x|687|0 9685|98|709||y|0|234 2315|98|809||x|564|0 2315|98|809||y|0|537... (2 Replies)
Discussion started by: nithins007
2 Replies

3. Shell Programming and Scripting

awk to insert a files names

I have a couple of text files which are named as 1.txt 2.txt 1000.txt 11.txt I want to cat/merge the contents of each text file into one single file like this 1 content of 1.txt 2 content of 2.txt 1000 content of 1000.txt 11 content of 11.txt (2 Replies)
Discussion started by: Lucky Ali
2 Replies

4. Shell Programming and Scripting

Concatenate many files which contents the same date as part of name file

Gents, I have lot of files in a folder where each file name includes the date of generation, then I would like to merge all the files for each date in a complete file. list of files in forder. dsd01_121104.txt dsd01_121105.txt dsd01_121106.txt dsd03_121104.txt dsd03_121105.txt... (7 Replies)
Discussion started by: jiam912
7 Replies

5. UNIX for Dummies Questions & Answers

Delete files whose file names are listed in a .txt file

hi, I need a help. I used this command to list all the log files which are for more than 10 days to a text file. find /usr/script_test -type f -mtime +10>>/usr/ftprm.txt I want all these files listed in the ftprm.txt to be ftp in another machine and then rm the files. Anyone can help me... (8 Replies)
Discussion started by: kamaldev
8 Replies

6. Shell Programming and Scripting

How to concatenate the files based upon the file name?

Hi Experts, I am trying to merge multiple files into one file based upon the file name. Testreport_Server1.txt ============ MonitoringReport_Server1.txt============ CentralReport_Server1 Here two files containing server1 should be merged into one file? How can i do... (16 Replies)
Discussion started by: sharsour
16 Replies

7. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

8. Shell Programming and Scripting

While loop a file containing list of file names until the files are found?

Hi, I have a control file which will contain all filenames(300) files. Loop through all the file names in the control files and check the existence of this file in another directory(same server). I need to infinitely(2 hrs) run this while loop until all the files are found. Once a file is found,... (5 Replies)
Discussion started by: laknar
5 Replies

9. Shell Programming and Scripting

Delete files except the file names available in the Except File

Hi, I need some help in the below scenario. I need to delete all the files from the directory except the file name available in the Except file. Like the folder ABC have files like A1.txt,A2.txt......A10.txt and also have a file named Except.txt with the content A3.txt,A4.txt Need a... (6 Replies)
Discussion started by: kban
6 Replies

10. Shell Programming and Scripting

Concatenate files based on names

Dear all, I have a list of files and I woulk like to concatenate some of them based on their name. Basically my files are names like that: file1_abcd_other_useless_letters_1_C1.txt file1_abcd_other_useless_letters_1_C2.txt file1_xywz_other_useless_letters_1_C1.txt... (4 Replies)
Discussion started by: giuliangiuseppe
4 Replies
FS_STOREBEHIND(1)					       AFS Command Reference						 FS_STOREBEHIND(1)

NAME
fs_storebehind - Enables asynchronous writes to the file server SYNOPSIS
fs storebehind [-kbytes <asynchrony for specified names>] [-files <specific pathnames>+] [-allfiles <new default (KB)>] [-verbose] [-help] fs st [-k <asynchrony for specified names>] [-f <specific pathnames>+] [-a <new default (KB)>] [-v] [-h] DESCRIPTION
The fs storebehind command enables the Cache Manager to perform a delayed asynchronous write to the File Server when an application closes a file. By default, the Cache Manager writes all data to the File Server immediately and synchronously when an application program closes a file -- that is, the close() system call does not return until the Cache Manager has actually transferred the final chunk of the file to the File Server. This command specifies the number of kilobytes of a file that can still remain to be written to the File Server when the Cache Manager returns control to the application. It is useful if users working on the machine commonly work with very large files, but also introduces the complications discussed in the CAUTIONS. Set either or both of the following in a single command: o To set a value that applies to all AFS files manipulated by applications running on the machine, use the -allfiles argument. This value is termed the default store asynchrony for the machine, and persists until the machine reboots. If it is not set, the default value is zero, indicating that the Cache Manager performs synchronous writes. As an example, the following setting means that when an application closes a file, the Cache Manager can return control to the application as soon as no more than 10 kilobytes of the file remain to be written to the File Server. -allfiles 10 o To set a value that applies to one or more individual files, and overrides the value of the -allfiles argument for them, combine the -kbytes and -files arguments. The setting persists as long as there is an entry for the file in the kernel table that the Cache Manager uses to track certain information about files. In general, such an entry persists at least until an application closes the file or exits, but the Cache Manager is free to recycle the entry if the file is inactive and it needs to free up slots in the table. To increase the certainty that there is an entry for the file in the table, issue the fs storebehind command shortly before closing the file. As an example, the following setting means that when an application closes either of the files bigfile and biggerfile, the Cache Manager can return control to the application as soon as no more than a megabyte of the file remains to be written to the File Server. -kbytes 1024 -files bigfile biggerfile Note that once an explicit value has been set for a file, the only way to make it subject to the default store asynchrony once again is to set -kbytes to that value. In other words, there is no combination of arguments that automatically makes a file subject to the default store asynchrony once another value has been set for the file. To display the settings that currently apply to individual files or to all files, provide the command's arguments in certain combinations as specified in OUTPUT. CAUTIONS
For the following reasons, use of this command is not recommended in most cases. In normal circumstances, an asynchronous setting results in the Cache Manager returning control to applications earlier than it otherwise does, but this is not guaranteed. If a delayed write fails, there is no way to notify the application, since the close() system call has already returned with a code indicating success. Writing asynchronously increases the possibility that the user will not notice if a write operation makes the volume that houses the file exceed its quota. As always, the portion of the file that exceeds the volume's quota is lost, which prompts a message such as the following: No space left on device To avoid losing data, it is advisable to verify that the volume housing the file has space available for the amount of data anticipated to be written. OPTIONS
-kbytes <asynchrony for specified names> Specifies the number of kilobytes of data from each file named by the -files argument that can remain to be written to the file server when the Cache Manager returns control to an application program that closed the file. The -files argument is required along with this argument. Provide an integer from the range 0 (which reinstates the Cache Manager's default behavior or writing synchronously) to the maximum AFS file size. -files <specific pathnames>+ Names each file to which the value set with the -kbytes argument applies. The setting persists as long as there is an entry for the file in the kernel table that the Cache Manager uses to track certain information about files. Because closing a file generally erases the entry, when reopening a file the only way to guarantee that the setting still applies is to reissue the command. If this argument is provided without the -kbytes argument, the command reports the current setting for the specified files, and the default store asynchrony. -allfiles <new default (KB)> Sets the default store asynchrony for the local machine, which is the number of kilobytes of data that can remain to be written to the file server when the Cache Manager returns control to the application program that closed a file. The value applies to all AFS files manipulated by applications running on the machine, except those for which settings have been made with the -kbytes and -files arguments. Provide an integer from the range 0 (which indicates the default of synchronous writes) to the maximum AFS file size. -verbose Produces output confirming the settings made with the accompanying -kbytes and -files arguments, the -allfiles argument, or all three. If provided by itself, reports the current default store asynchrony. -help Prints the online help for this command. All other valid options are ignored. OUTPUT
If none of the command's options are included, or if only the -verbose flag is included, the following message reports the default store asynchrony (the setting that applies to all files manipulated by applications running on the local machine and for which not more specific asynchrony is set). Default store asynchrony is <x> kbytes. A value of 0 (zero) indicates synchronous writes and is the default if no one has included the -allfiles argument on this command since the machine last rebooted. If the -files argument is provided without the -kbytes argument, the output reports the value that applies to each specified file along with the default store asynchrony. If a particular value has previously been set for a file, the following message reports it: Will store up to <y> kbytes of <file> asynchronously. Default store asynchrony is <x> kbytes. If the default store asynchrony applies to a file because no explicit -kbytes value has been set for it, the message is instead as follows: Will store <file> according to default. Default store asynchrony is <x> kbytes. If the -verbose flag is combined with arguments that set values (-files and -kbytes, or -allfiles, or all three), there is a message that confirms immediately that the setting has taken effect. When included without other arguments or flags, the -verbose flag reports the default store asynchrony only. EXAMPLES
The following command enables the Cache Manager to return control to the application program that closed the file test.data when 100 kilobytes still remain to be written to the File Server. The -verbose flag produces output that confirms the new setting, and that the default store asynchrony is zero. % fs storebehind -kbytes 100 -files test.data -verbose Will store up to 100 kbytes of test.data asynchronously. Default store asynchrony is 0 kbytes. PRIVILEGE REQUIRED
To include the -allfiles argument, the issuer must be logged in as the local superuser "root". To include the -kbytes and -files arguments, the issuer must either be logged in as the local superuser "root" or have the "w" (write) permission on the ACL of each file's directory. To view the current settings (by including no arguments, the -file argument alone, or the -verbose argument alone), no privilege is required. SEE ALSO
afsd(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 FS_STOREBEHIND(1)
All times are GMT -4. The time now is 03:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy