I have a file (email) containing email addresses.
I have a second file (terms) that contains simple regular expressions and words/characters. Here are some examples:
\.trainee
\.group
\.web
I want to go through email and delete lines containing the expressions/words from terms and write... (1 Reply)
hey guys,
I'm trying to call and modify multiple files inside the for loop, i can't get it to work...
------------------------
AFILE=/dir/a_file.txt
BFILE=/dir/b_file.txt
CFILE=/dir/c_file.txt
ADESTFILE=/dir/a_dest_file.txt
BDESTFILE=/dir/b_dest_file.txt... (6 Replies)
Hi all,
I would like to simply read a file which lists a number of pathnames and files, then search and replace key strings using a few vi commands:
:1,$s/search_str/replace_str/g<return>
but I am not sure how to automate the <return> of these vis commands when I am putting this in a... (8 Replies)
Hi all,
Here is an outline of the problem:
#variable declared at start of script
x=0;
#a function that increments x by 1 every 10 seconds
incrementX(){
increments x every 10 seconds;
}
#i want this to output the value of x every second. The problem is that x is always reported... (3 Replies)
Hi,
I have 1000 text files in a folder that are labeled data1.txt all the way to data1000.txt. I want to write a small script that manipulates the text files in this way:
(1) cut the 2nd and 9th columns of the text files
(2) sort by the numerical value in the 9th column
(3) then save the rows... (3 Replies)
Hi all ,
i want to pass multiple files as input to a for loop
for i in file1 file2 file3
do
some awk action < $i >> $i.out
done
but im getting error in that for loop is the way i use to pass files to awk using for correct and
2.we can directly pass multiple files to awk as... (7 Replies)
Hi I need to loop until some files are not there .If lck file is there I need to sleep.until its not there
I am writing a code like this
while && &&
do
echo "Lck file exits"
sleep 1
done
But this one is not working.Can some one help here please (1 Reply)
Hi Guys,
I need to access multiple directories whcih is following similar structure and need to copy those files in desitination path.
for eg :
if ]
then
cd ${DIR}/Mon/loaded
echo "copying files to $GRS_DIR"
cp * ${DIR}/Mon/
echo "Files of Monday are Copied"
fi
if ]
then... (5 Replies)
Hi Everybody,
I'm a newbie to shell scripting, and I'd appreciate some help. I have a bunch of .txt files that have some unwanted content. I want to remove lines 1-3 and 1028-1098.
#!/bin/bash
for '*.txt' in <path to folder>
do
sed '1,3 d' "$f";
sed '1028,1098 d' "$f";
done
I... (2 Replies)
while IFS= read -r line
do
# sV for version detection
nmap -T4 -Pn -v -sS "$line" > "text/$line"
done < <(grep '' $file)
Hi,
where line represents the IP.
I am using NMAP to do scanning.
How can I set to execute that command in the loop several concurrently at a time instead of one... (5 Replies)
Discussion started by: alvinoo
5 Replies
LEARN ABOUT REDHAT
losetup
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)