Sponsored Content
Top Forums Shell Programming and Scripting File exist for multiple files Post 302902821 by vbe on Thursday 22nd of May 2014 11:34:17 AM
Old 05-22-2014
What OS and shell are you using?
Because this syntax seem unorthodox to me:
Code:
[-f `ls $Direct/{$file}*|wc -l ` -eq 0]

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare data in 2 files and delete if file exist

Hi there, I have written a script called "compare" (see below) to make comparison between 2 files namely test_put.log and Output_A0.log #!/bin/ksh while read file do found="no" while read line do echo $line | grep $file > /dev/null if then echo $file found found="yes" break fi... (3 Replies)
Discussion started by: lweegp
3 Replies

2. Shell Programming and Scripting

How to check a file exist and do a copy of other files

Hi, I would like to perform bash which would check the file A.txt to be size 0 or not. If the size is 0, I would copy file B.txt to replace A.txt. Please help. Thanks. -Jason (6 Replies)
Discussion started by: ahjiefreak
6 Replies

3. Shell Programming and Scripting

Delete files if they exist

In a directory a number of files named res0.om res1.om ... resN.om where N can be any unknown number between 1 and 999 Please help me filling out the gaps in the following csh script: I need to delete all files exept res0.om The easy way is rm res1* rm res2* rm res3* rm res4*... (5 Replies)
Discussion started by: pederlol
5 Replies

4. UNIX for Dummies Questions & Answers

copy files as space exist in file name..

Hi, i am having a directory in which files are having space in the name . $ls -1 aa b.txt my file.pdf lost file.csv foo_file.txti want to copy those file to some where with date +%F as extension . But it failed for the file having space. #!/bin/sh ls -1 >tt for var in `cat tt` do b=$var... (2 Replies)
Discussion started by: posix
2 Replies

5. Shell Programming and Scripting

Find out whether files exist.

I have the following data stored in a file. 1 /home/file13 /home/file2 2 /home/file41 /home/file654 3 /home/file61 /home/file45 4 /home/file81 /home/file43 ... I want to print the first column provided the files represented by the second and third column exist. How to do that? (3 Replies)
Discussion started by: kevintse
3 Replies

6. Shell Programming and Scripting

check if multiple folders exist

I want to check if some directories with common prefix exist under current directory with bash, say, I have dictories like: dirct_1 dirct_2 dirct_3 ... in the current directory. I did: if then echo " directories exist " else echo " directories not exist " fi (3 Replies)
Discussion started by: cristalp
3 Replies

7. Shell Programming and Scripting

Code to remove files when corresponding file doesnt exist isnt working.

I am trying to add some code to the begging of a script so that it will remove all the .transcript files, when their is no coressponding .wav file. But it doesnt work. This is the code I have added: for transcriptfile in `$voicemaildir/*.transcript`; do wavfile=`echo $transcriptfile | cut -d'.'... (2 Replies)
Discussion started by: ghurty
2 Replies

8. UNIX for Dummies Questions & Answers

Checking if multiple directories exist

I need to create multiple directories if those directories do not exist already. How would you go by doing this. What I have so far. array=(one two three) for I in ${array} do if ] then mkdir ${I} fi doneI have a good feeling this is done incorrectly. The error I am... (2 Replies)
Discussion started by: jrymer
2 Replies

9. Shell Programming and Scripting

Shell script to check files if exist else touch the file

Hi All, Thanks in Advance I wrote the following code if then echo "version is 1.1" for i in "subscriber promplan mapping dedicatedaccount faflistSub faflistAcc accumulator pam_account" do FILE="SDP_DUMP_$i.csv" echo "$FILE" ... (5 Replies)
Discussion started by: aealexanderraj
5 Replies

10. UNIX for Beginners Questions & Answers

Check if 10 files exist

Hi All, Whenever i get 10 files(file names like sales*) then another file need to create. May i know how to implement this in KSH. (4 Replies)
Discussion started by: siddireddy
4 Replies
DTAUS(5)																  DTAUS(5)

NAME
dtaus - Converter for DTAUS files DESCRIPTION
The dtaus(1) program reads and writes German DTAUS files. DTAUS is an semi-acronym for DatenTragerAUStausch. It is used by German credit institutes in order to implement money exchanges between accounts and credit institutes. These files are always called DTAUS0.TXT. Since they are shipped in a weird ascii format that is not quite readable and writable for human beings a special control format was invented. The dtaus(1) program reads and writes such a control file and generates a proper DTAUS file if requested or decodes one. CONTROL FILE
The control file implements a very simple format which was invented only for use with the dtaus(1) program. Like with many *nix configura- tion files empty lines and those beginning with a hash mark (``#'') are ignored. The remaining file is splitted into three major parts: one BEGIN record (representing the A record), several regular records (representing C records) and one optional END record (representing the E record), which is ignored when the control file is read but is extracted from the bank file if one is decoded. Here's a short sample for a control file: BEGIN { Art type Name Martin Schulze Konto 123545 BLZ 2004002 Ausfuehrung 23.12.2001 Euro } { Transaktion transaction Name Martha Schulze Konto 98832 BLZ 2004003 Betrag 20.00 Zweck Gebuhr Wohnheimnetz Text AnschluB u. 11+12.97 } ... Please note that several field names are used in both the BEGIN and the regular record. When used in the BEGIN record they denote your name and your bank account. When used in a regular record they are affiliated with your customers data. You may use up to 15 fields entitled as Text. They will be recorded one by one and stored into additional data records using the same order. This way you could add a detailed description of the type of money transfer if you like. The contents of the field Zweck are most probably what the customer will see on their bank statements. The field Ausfuehrung is optional and denotes the day when the entire transaction should be processed. The date has to be given as DD.MM.YYYY and will be translated into the resulting bank file literally. It may not be younger than the creation date of the file which will automatically be inserted by dtaus(1). The processing date also may not be more than 15 years later than the creation date. Explanation of type One of the following: LK Lastschrift Kundenseitig GK Gutschrift Kundenseitig LB Lastschrift Bankseitig GB Gutschrift Bankseitig Explanation of transaction One of the following: Einzug Bankeinzug Gutschrift Uberweisung Vermogen [JJJJ] Vermogenswirksame Leistung mit Sparzulage. Als Argument kann das Jahr angegeben werden, fur das diese Leistung gilt. Wenn es weggelassen, wird, verwendet dtaus das aktuelle Jahr. Vom Jahr wird nur die letzte Ziffer verwendet, es muB daher auch nicht vollstandig angegeben werden. Vermoegen [JJJJ] Wie Vermogen, jedoch ohne Umlaut. E-Cash Lastschrift aus Verfugung im elecctronic Cash-System E-Cash-A Lastschrift aus Verfugung im elecctronic Cash-System mit auslandischer Karte. You may only use one of these for the entire file. You are not allowed to switch between Einzug and Gutschrift within the same file. If you require the credit institute to process both types, you'll have to provide two separate diskettes. Support for Euro From January 1st 2002 the currency in many European countries, Germany is among these, changes to Euro. Hence, money transfer changes from DM (formerly known as ``Deutsche Mark'') to Euro. The format specification of DTAUS was meant for DM but was modified in 2001 to support Euro as well. The current version of dtaus(1) supports both currencies. It defaults to using Euro, however. To switch to DM, simply add the keyword DM (or Euro respectively if this version was compiled without Euro support as default) to the BEGIN record. If no currency keyword is given, the compiled in decides (upstream source defaults to Euro). Character Encoding German Umlauts are converted into two 7-bit characters on the fly so you don't need to care about them. Since the DTAUS0.TXT file only uses uppercase letters every text is also converted to uppercase. Except for the way records are delimited the format should be self explanatory. SEE ALSO
dtaus(1). DTAUS files use a special but simple and publically documented format. It is included in the distribution of dtaus(1) as dtaus.txt. 17 November 2001 DTAUS(5)
All times are GMT -4. The time now is 06:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy