Sponsored Content
Full Discussion: find command in for loop
Top Forums UNIX for Dummies Questions & Answers find command in for loop Post 302584201 by verdepollo on Thursday 22nd of December 2011 11:18:25 AM
Old 12-22-2011
You need to evaluate the command:
Code:
for f in $(find /Users/vasu -name "*.txt")
do
echo "$f"
done

 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

For Loop with find

I'm trying to write a script to archive some log files, and I'm getting a little stuck. My 'find' command by itself works great, returning all of the log files I need, but when I try to combine it with my loop, I'm getting an error. Here's what I have so far: for FILENAME in $(find . -type f... (4 Replies)
Discussion started by: kadishmj
4 Replies

3. Shell Programming and Scripting

How to combine "find" command in for each loop (tcsh)

Hello I was wandering if I can combine find command in side for each loop in unix the main propose is to change some thing in files from several types and not all of them is this possible ? (on liner script? ) tnx for the helppers (3 Replies)
Discussion started by: umen
3 Replies

4. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

5. Shell Programming and Scripting

find command in while loop - how to get control when no files found?

I have the following statement in script: find ${LANDING_FILE_DIR}${BTIME_FILENAME_PATTERN2} -print | while read file; do ... done When there are no files located by the find comand it returns: "find: bad status-- /home/rnitcher/test/....." to the command line How do I get control in... (3 Replies)
Discussion started by: mavsman
3 Replies

6. AIX

using find in for loop

hello gurus, src="/home/training" typ="*.sh" for i in `find $src -name $typ` do ... .. done the above code piece is giving this error: find: 0652-009 There is a missing conjunction I tried this way: for i in `find $src -name "$typ"` But then it didn't get any files, though there... (11 Replies)
Discussion started by: muthursyamburi
11 Replies

7. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

8. Shell Programming and Scripting

find in for loop

What's wrong with this script for i in Users.csv anc.csv > do > find . -name $i > doneDouble post. Continue here. (0 Replies)
Discussion started by: theshashi
0 Replies

9. Shell Programming and Scripting

find in for loop

whats wrong with this script for i in Users.csv abd.csv > do > find . -name $i > done (2 Replies)
Discussion started by: theshashi
2 Replies

10. UNIX for Dummies Questions & Answers

While loop, input from find command

Hello nix Experts, I am a *nix rookie and have run into this issue, can some one help me here and let me know what I am doing wrong. /home/user1> while read n > do > echo $n > done < <(find . -type f -ctime -1 | grep abc) I am getting the below error: -sh: syntax error near... (5 Replies)
Discussion started by: babyPen1985
5 Replies
LOSETUP(8)						       MAINTENANCE COMMANDS							LOSETUP(8)

NAME
losetup - set up and control loop devices SYNOPSIS
Get info: losetup loopdev losetup -a losetup -j file [-o offset] Delete loop: losetup -d loopdev... Print name of first unused loop device: losetup -f Setup loop device: losetup [{-e|-E} encryption] [-o offset] [--sizelimit limit] [-p pfd] [-r] {-f[--show]|loopdev} file Resize loop device: losetup -c loopdev DESCRIPTION
losetup is used to associate loop devices with regular files or block devices, to detach loop devices and to query the status of a loop device. If only the loopdev argument is given, the status of the corresponding loop device is shown. Encryption It is possible to specify transfer functions (for encryption/decryption or other purposes) using one of the -E and -e options. There are two mechanisms to specify the desired encryption: by number and by name. If an encryption is specified by number then one has to make sure that the Linux kernel knows about the encryption with that number, probably by patching the kernel. Standard numbers that are always present are 0 (no encryption) and 1 (XOR encryption). When the cryptoloop module is loaded (or compiled in), it uses number 18. This cryptoloop module will take the name of an arbitrary encryption type and find the module that knows how to perform that encryption. OPTIONS
-a, --all show status of all loop devices -c, --set-capacity loopdev force loop driver to reread size of the file associated with the specified loop device -d, --detach loopdev... detach the file or device associated with the specified loop device(s) -e, -E, --encryption encryption_type enable data encryption with specified name or number -f, --find find the first unused loop device. If a file argument is present, use this device. Otherwise, print its name -h, --help print help -H, --phash hash_type Specify the password hash function. Valid values are: sha512(default), sha256, sha384, rmd160, none. -j, --associated file show status of all loop devices associated with given file -k, --keybits num set the number of bits to use in key to num. -o, --offset offset the data start is moved offset bytes into the specified file or device --sizelimit limit the data end is set to no more than sizelimit bytes after the data start -p, --pass-fd num read the passphrase from file descriptor with number num instead of from the terminal -r, --read-only setup read-only loop device --show print device name if the -f option and a file argument are present. The short form of this option (-s) is deprecated. This short form could be in collision with Loop-AES implementation where the same option is used for --sizelimit. -v, --verbose verbose mode RETURN VALUE
losetup returns 0 on success, nonzero on failure. When losetup displays the status of a loop device, it returns 1 if the device is not con- figured and 2 if an error occurred which prevented losetup from determining the status of the device. FILES
/dev/loop0, /dev/loop1, ... loop devices (major=7) EXAMPLE
If you are using the loadable module you must have the module loaded first with the command # modprobe loop Maybe also encryption modules are needed. # modprobe des # modprobe cryptoloop The following commands can be used as an example of using the loop device. # dd if=/dev/zero of=/file bs=1k count=100 # losetup -e des /dev/loop0 /file Password: Init (up to 16 hex digits): # mkfs -t ext2 /dev/loop0 100 # mount -t ext2 /dev/loop0 /mnt ... # umount /dev/loop0 # losetup -d /dev/loop0 If you are using the loadable module you may remove the module with the command # rmmod loop RESTRICTION
DES encryption is painfully slow. On the other hand, XOR is terribly weak. Both are insecure nowadays. Some ciphers may require a licence for you to be allowed to use them. Cryptoloop is deprecated in favor of dm-crypt. For more details see cryptsetup(8). AVAILABILITY
The losetup command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. Linux 2003-07-01 LOSETUP(8)
All times are GMT -4. The time now is 05:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy