Sponsored Content
Top Forums Shell Programming and Scripting while read loop w/ a nested if statement - doesn't treat each entry individually Post 302150565 by littlefrog on Tuesday 11th of December 2007 08:18:39 PM
Old 12-11-2007
One other note -

I took out the '> /dev/null 2>&1' from the ldap search command - and i only see one instance of 'ibm-replcationState=ready' returned to my screen. -

So it looks like for some reason, it's only run that part of the loop once?? - Stange
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

nested read

I am hoping someone can help me with this one. I am writing a ksh script on Solaris. I want to read in host names and some other info from a file, do an "rsh host 'shutdown'" (or any uname for now until I get it working), and then be given some options. The problem is I am using while read... (2 Replies)
Discussion started by: TioTony
2 Replies

2. Shell Programming and Scripting

Nested while read line loop

Hi, Can anyone please help me: i'm trying to read a file with directory-names , then go to that directory and read another (output) file to perform some tasks per line (second read line in the part of script below). The problem is that after the nested while loop has finished, the first while... (7 Replies)
Discussion started by: Rakker
7 Replies

3. UNIX for Dummies Questions & Answers

Nested If statement within Do / Done

Hi all! I'm really hoping you can help me out here; now i have searched and searched and have at least worked out that you can't have a nested if statement with a 'done' in it (as i have) as you're killing the parent before the child. So here's what i have, and here's hoping someone can help... (2 Replies)
Discussion started by: dalgibbard
2 Replies

4. Shell Programming and Scripting

If-statement nested in case

I'm trying to write case statements with 'if statements' embedded inside of them. I'm using the korn shell but it's not functioning. If I want to see if a string exists in a file and then perform an action, what would be the best way to do this? For file "asg51fin" to delete a line if a... (1 Reply)
Discussion started by: dazeman27
1 Replies

5. Shell Programming and Scripting

Perl nested if statement

I'm just having a bit of trouble running this code. It tells me that there's a syntax error on line 29. Any help appreciated. #!/usr/bin/perl # # Phone Book Application # %phonebook = ( "Wayne", '34687368', "Home", '378643287', "Work", '017374637', "School",... (2 Replies)
Discussion started by: cabaiste
2 Replies

6. Shell Programming and Scripting

Nested While loop doesn't end

Hi, Below is my script in which i am using nested while loop to read two files and move the files to a remote server. My issue is that the 2nd while loop doesn't stop executing and it keeps on executing. Can someone please let me know where i have gone wrong. myFile=$ESER_TEST_FILES ... (2 Replies)
Discussion started by: funonnet
2 Replies

7. UNIX for Dummies Questions & Answers

Read statement within while read loop

hi, this is my script #!/bin/ksh cat temp_file.dat | while read line do read test if ]; then break else echo "ERROR" fi done when i execute this code , the script does wait for the user input . it directly prints "ERROR" and terminates after the no. of times as there... (3 Replies)
Discussion started by: siva1612
3 Replies

8. UNIX for Dummies Questions & Answers

Statement to find if an entry exists in a file

I need to check if an entry input by the user is in a file. If so, I need to run a command, and if it does not exist then it should output entry does not exist. So I have so far... echo "Enter record:" read record //command || //command Can I use an if statement to do this? (3 Replies)
Discussion started by: itech4814
3 Replies

9. Shell Programming and Scripting

How come this if statement doesn't work?

greetings, the following code isn't working as i expect it to. the first dbl brackets do but the second set gets ignored. ie: if i'm on t70c6n229 it echoes "Something" and i expect it not to. what am i missing? if " ]] || " ]]; then echo "Something" fi thanx! (9 Replies)
Discussion started by: crimso
9 Replies

10. Shell Programming and Scripting

awk doesn't understand 'read' statement!!!

While working on awk programming, i found that it doesn't understand 'read' statement. Then what's the use of 'continue' and 'break' statement in awk. For ex: awk '{k=1; while (k<10) {print $0; k++}}' emp.lst Now, please say if I want to put the logic that after priting 1 line, it will ask for... (13 Replies)
Discussion started by: ravisingh
13 Replies
LOSETUP(8)						       MAINTENANCE COMMANDS							LOSETUP(8)

NAME
losetup - set up and control loop devices SYNOPSIS
losetup [ -e encryption ] [ -o offset ] loop_device file losetup [ -d ] loop_device 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 loop_device argument is given, the status of the corresponding loop device is shown. OPTIONS
-d detach the file or device associated with the specified loop device. -e encryption enable data encryption. The following keywords are recognized: NONE use no encryption (default). XOR use a simple XOR encryption. DES use DES encryption. DES encryption is only available if the optional DES package has been added to the kernel. DES encryption uses an additional start value that is used to protect passwords against dictionary attacks. -o offset the data start is moved offset bytes into the specified file or device. 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 # insmod loop.o 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. AUTHORS
Original version: Theodore Ts'o <tytso@athena.mit.edu> Original DES by: Eric Young <eay@psych.psy.uq.oz.au> Linux Nov 24 1993 LOSETUP(8)
All times are GMT -4. The time now is 08:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy