Sponsored Content
Top Forums UNIX for Advanced & Expert Users Recursion list for rm -R in find Post 302827019 by Corona688 on Thursday 27th of June 2013 06:17:11 PM
Old 06-27-2013
find finds things in arbitrary order, just the order they're stored in the directory entries on disk -- which is completely arbitrary. It's very difficult to say where this command started.

Last edited by Corona688; 06-27-2013 at 07:23 PM..
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

recursion

I'm using the UNIX csh and i wish to use recursion to nav my way up (or down as it is) a given folder. My little test script is called "r" and takes a folder as argv (or $1) #!/bin/tcsh -f set allFiles = `ls -A $argv` cd $argv while ($#allFiles) if (-d... (1 Reply)
Discussion started by: gsjf
1 Replies

2. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies

3. Shell Programming and Scripting

recursion too deep

I am running a korn shell script which has a recursive function. The script ran for 117 iterations and ended up with the following error "recursion too deep". what should be done to avert this? Thanks in advance Swamy p.s. I am on UNIX MPRAS V4 (3 Replies)
Discussion started by: swamy455
3 Replies

4. Shell Programming and Scripting

Help Help Help in recursion

Hello every body. I am trying to find the factorial using the following code. But it is giving the syntax error. I tried very much but in vain. Thanks in advance for helping me factorial() { if then y=`expr $1 - 1` x=$(( $1 \* factorial $y ))... (6 Replies)
Discussion started by: murtaza
6 Replies

5. Shell Programming and Scripting

diffrence in non recusion and recursion

Hi, If i have given to write a prog for factorial in C using recursion and without recursion which one is better in what condition and why ? thanks (2 Replies)
Discussion started by: useless79
2 Replies

6. Programming

Recursion

I want to halt a tail recursive function after certain validation. I want to come out of entire recursion without unwinding phase. How can i achieve that . The coding is done in C language. (5 Replies)
Discussion started by: joshighanshyam
5 Replies

7. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

8. Programming

C Recursion (explain)

Hi, Question: how come the output is like that? Can explain to me abit. I am learning C. Thanks! #include <stdio.h> #include <string.h> void printit(char line_of_char, int index); int main() { char line_of_char; int index = -1; strcpy(line_of_char, "This is a string."); ... (5 Replies)
Discussion started by: seede
5 Replies

9. Shell Programming and Scripting

script recursion

Can someone please explain me why the following script calls it self recursively: #!/bin/bash echo Called $0 while this not: #!/bin/bash echo Called $($0) Thanks (6 Replies)
Discussion started by: superpointer
6 Replies

10. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies
CPM(5)								   File formats 							    CPM(5)

NAME
cpm - CP/M disk and file system format DESCRIPTION
Characteristic sizes Each CP/M disk format is described by the following specific sizes: Sector size in bytes Number of tracks Number of sectors Block size Number of directory entries Logical sector skew Number of reserved system tracks A block is the smallest allocatable storage unit. CP/M supports block sizes of 1024, 2048, 4096, 8192 and 16384 bytes. Unfortunately, this format specification is not stored on the disk and there are lots of formats. Accessing a block is performed by accessing its sec- tors, which are stored with the given software skew. Device areas A CP/M disk contains three areas: System tracks (optional) Directory Data The system tracks store the boot loader and CP/M itself. In order to save disk space, there are non-bootable formats which omit those sys- tem tracks. The term disk capacity always excludes the space for system tracks. Note that there is no bitmap or list for free blocks. When accessing a drive for the first time, CP/M builds this bitmap in core from the directory. Directory entries The directory is a sequence of directory entries (also called extents), which contain 32 bytes of the following structure: St F0 F1 F2 F3 F4 F5 F6 F7 E0 E1 E2 Xl Bc Xh Rc Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al St is the status; possible values are: 0-15: used for file, status is the user number 16-31: used for file, status is the user number (P2DOS) or used for password extent (CP/M 3 or higher) 32: disc label 33: time stamp (P2DOS) 0xE5: unused F0-E2 are the file name and its extension. They may consist of any printable 7 bit ASCII character but: < > . , ; : = ? * [ ]. The file name must not be empty, the extension may be empty. Both are padded with blanks. The highest bit of each character of the file name and extension is used as attribute. The attributes have the following meaning: F0: requires set wheel byte (Backgrounder II) F1: public file (P2DOS, ZSDOS), foreground-only command (Backgrounder II) F2: date stamp (ZSDOS), background-only commands (Backgrounder II) F7: wheel protect (ZSDOS) E0: read-only E1: system file E2: archived Public files (visible under each user number) are not supported by CP/M 2.2, but there is a patch and some free CP/M clones support them without any patches. The wheel byte is (by default) the memory location at 0x4b. If it is zero, only non-privileged commands may be executed. Xl and Xh store the extent number. A file may use more than one directory entry, if it contains more blocks than an extent can hold. In this case, more extents are allocated and each of them is numbered sequentially with an extent number. If a physical extent stores more than 16k, it is considered to contain multiple logical extents, each pointing to 16k data, and the extent number of the last used logical extent is stored. Note: Some formats decided to always store only one logical extent in a physical extent, thus wasting extent space. CP/M 2.2 allows 512 extents per file, CP/M 3 and higher allow up to 2048. Bit 5-7 of Xl are 0, bit 0-4 store the lower bits of the extent number. Bit 6 and 7 of Xh are 0, bit 0-5 store the higher bits of the extent number. Rc and Bc determine the length of the data used by this extent. The physical extent is divided into logical extents, each of them being 16k in size (a physical extent must hold at least one logical extent, e.g. a blocksize of 1024 byte with two-byte block pointers is not allowed). Rc stores the number of 128 byte records of the last used logical extent. Bc stores the number of bytes in the last used record. The value 0 means 128 for backward compatibility with CP/M 2.2, which did not support Bc. Al stores block pointers. If the disk capacity is less than 256 blocks, Al is interpreted as 16 byte-values, otherwise as 8 double-byte- values. A block pointer of 0 marks a hole in the file. If a hole covers the range of a full extent, the extent will not be allocated. In particular, the first extent of a file does not necessarily have extent number 0. A file may not share blocks with other files, as its blocks would be freed if the other files is erased without a following disk system reset. CP/M returns EOF when it reaches a hole, whereas UNIX returns zero-value bytes, which makes holes invisible. Time stamps P2DOS and CP/M Plus support time stamps, which are stored in each fourth directory entry. This entry contains the time stamps for the extents using the previous three directory entries. Note that you really have time stamps for each extent, no matter if it is the first extent of a file or not. The structure of time stamp entries is: 1 byte status 0x21 8 bytes time stamp for third-last directory entry 2 bytes unused 8 bytes time stamp for second-last directory entry 2 bytes unused 8 bytes time stamp for last directory entry A time stamp consists of two dates: Creation and modification date (the latter being recorded when the file is closed). CP/M Plus further allows optionally to record the access instead of creation date as first time stamp. 2 bytes (little-endian) days starting with 1 at 01-01-1978 1 byte hour in BCD format 1 byte minute in BCD format Disc labels CP/M Plus support disc labels, which are stored in an arbitrary directory entry. The structure of disc labels is: 1 byte status 0x20 F0-E2 are the disc label 1 byte mode: bit 7 activates password protection, bit 6 causes time stamps on access, but 5 causes time stamps on modifications, bit 4 causes time stamps on creation and bit 0 is set when a label exists. Bit 4 and 6 are exclusively set. 1 byte password decode byte: To decode the password, xor this byte with the password bytes in reverse order. To encode a password, add its characters to get the decode byte. 2 reserved bytes 8 password bytes 4 bytes label creation time stamp 4 bytes label modification time stamp Passwords CP/M Plus supports passwords, which are stored in an arbitrary directory entry. The structure of these entries is: 1 byte status (user number plus 16) F0-E2 are the file name and its extension. 1 byte password mode: bit 7 means password required for reading, bit 6 for writing and bit 5 for deleting. 1 byte password decode byte: To decode the password, xor this byte with the password bytes in reverse order. To encode a password, add its characters to get the decode byte. 2 reserved bytes 8 password bytes SEE ALSO
mkfs.cpm(1), fsck.cpm(1), fsed.cpm(1), cpmls(1) CP
/M tools March 30, 2010 CPM(5)
All times are GMT -4. The time now is 08:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy