Sponsored Content
Full Discussion: Continuous for loop
Top Forums UNIX for Beginners Questions & Answers Continuous for loop Post 303016195 by jim mcnamara on Saturday 21st of April 2018 09:27:28 AM
Old 04-21-2018
Have you tried anything at all? Please show us.

This question, if it is not homework, needs some explanation. For example, I could answer your question correctly using a weird programming language like LISP.
Usually you need to tell us:
1. UNIX type like linux, AIX, etc
2. language you are using: like C, COBOL, bash
Then we can give you good answers.

This sounds like homework to me. We have a special forum for that and may ask you to fill out the homework template first, where you have to answer those questions above first as well.
This User Gave Thanks to jim mcnamara For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing dupicate lines in the file ..(they are not continuous)

I have duplicates records in a file, but they are not consecutive. I want to remove the duplicates , using script. Can some one help me in writing a ksh script to implement this task. Ex file is like below. 1234 5689 4556 1234 4444 (7 Replies)
Discussion started by: Srini75
7 Replies

2. Shell Programming and Scripting

Continuous Flat file parsing

Hi all, I'm looking for some tips on an ideal method of parsing a huge fixed length flat file (~500gb) into a delimited text file. We have to do this because our data warehouse platform only accepts delimited file loads. In the past, we've done this with SAS (only on smaller ~40GB files) by... (1 Reply)
Discussion started by: cg2
1 Replies

3. Shell Programming and Scripting

Rename files with continuous numbers

I have a huge collection of HTML files. They have their own file names with htmlextension. I want to rename each of these files with continuous numbers starting from 1.html till the last count of files. Simply it means that if there are three files like this abc.html cdfhg.html rmbd.htmlthen... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

4. Shell Programming and Scripting

Continuous checking of a file

I have a requirement like this... I want to go to a particular server for which i have acess .I want to do a ssh to that server from one server and check if a file is theer or not..and i need the script to chcek continuosly till it finds the file.When it finds the file i want it to come out... (9 Replies)
Discussion started by: kanta_bhakti
9 Replies

5. Shell Programming and Scripting

Extract Big and continuous regions

Hi all, I have a file like this I want to extract only those regions which are big and continous chr1 3280000 3440000 chr1 3440000 3920000 chr1 3600000 3920000 # region coming within the 3440000 3920000. so i don't want it to be printed in output chr1 3920000 4800000 chr1 ... (2 Replies)
Discussion started by: amrutha_sastry
2 Replies

6. Shell Programming and Scripting

Detect continuous number as range

I have 100k data like this bellow , i want to group data to range 171 172 173 174 175 176 179 182 183 187 188 189 1900 1901 1903 1904 1905 1906 (10 Replies)
Discussion started by: before4
10 Replies

7. Shell Programming and Scripting

Continuous Copying from a directory to another.

Hello Folks, Looking for a script, where i can check for the existing of the files in a directory and copying to another. How can i achieve it in loop for over period of time. whatever files comes into the folder copied in another without duplicate and should be continuous loop. ... (8 Replies)
Discussion started by: sadique.manzar
8 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 size] [-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
The size and offset arguments may be followed by binary (2^N) suffixes KiB, MiB, GiB, TiB, PiB and EiB (the "iB" is optional, e.g. "K" has the same meaning as "KiB") or decimal (10^N) suffixes KB, MB, GB, PB and EB. -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 -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. -N, --nohashpass Do not hash the password. By default, Debian systems run the password through a hash function, non-Debian systems tend not to. -o, --offset offset the data start is moved offset bytes into the specified file or device --sizelimit size the data end is set to no more than size 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 package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. Linux 2003-07-01 LOSETUP(8)
All times are GMT -4. The time now is 02:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy