Sponsored Content
Top Forums Shell Programming and Scripting Using grep within a while loop Post 302516471 by turkishvan on Saturday 23rd of April 2011 01:58:17 PM
Old 04-23-2011
Hi all,

thanks so much for the help
I have found out the reason to why the grep do not work
cause i have been saving the file to a shared folder on a virtual ubuntu guest on window 64bit machine
and at the end of line there is an appened "^M" which was not visualised and i have it replaced and things worked!

Thanks again

Y
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep in a loop

Hi , I am trying a script which takes user input userid . I am stuck how to check whether that is a valid user id or not in the audit log files. My code is : cd $CCP_AUDIT cat * > /export/home/$USR/l***/files echo "UserId:\c" read UserId #Date Function echo "DATE : \c" read xxx I... (7 Replies)
Discussion started by: gundu
7 Replies

2. UNIX for Dummies Questions & Answers

grep -v while loop

alist contain: a b c d e blist contain: a b c the code: #!/usr/bin/ksh cat blist | while read line do grep -V "$line" alist > data done (8 Replies)
Discussion started by: bobo
8 Replies

3. Shell Programming and Scripting

Grep commands in loop

Hi All, Reference to my previous post I need to compare all the lines in the file1 with file2 for this condition if file1 {$3,$5} ==file2 {$3,$5} then grep file2{$1}latest date. need output in file3 10/04/2008 09/04/2008 09/04/2008 08/04/2008 can anyone suggest me Thanks... (0 Replies)
Discussion started by: karthikn7974
0 Replies

4. Shell Programming and Scripting

Help with grep inside an if loop

Hello All, I have been reading posts on here for a while, but this is my first post. I have a document in which many sentences appear, and I am piping it through an exterior script which will tag each word in the document with its part of speech (not part of my script, just background). The... (3 Replies)
Discussion started by: daf189
3 Replies

5. UNIX for Dummies Questions & Answers

grep sed and a loop

:wall: I have a requirement to search a log file that never rotates for certain values. If I find them I pipe them to a another file. To log file is constanyl being appened with new lines and never rotating Easy so far. The problem is I dont want to pipe out matches already seen before. ... (3 Replies)
Discussion started by: gunnahafta
3 Replies

6. Shell Programming and Scripting

Help on grep in a do while loop

So this is what I'm trying to do: I have a file called registry.txt which has a list of registry entries I want to search for. I have another file called inctrl.txt on which I want to perform the search on. Here's the example contents of registry.txt SOFTWARE\Microsoft\Security... (3 Replies)
Discussion started by: r4v3n
3 Replies

7. Red Hat

using grep in a while loop

Hello everybody, I have been searching it, but it seems I am unable to find the correct information, that s why I am asking you guys, hoping somebody get an idea. Here is my problem : I want a script to loop until a string is identified in a log file. Here is the script : #!/bin/sh... (5 Replies)
Discussion started by: guyiom
5 Replies

8. Homework & Coursework Questions

GREP loop

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I need to search through the users home directories for keywords, display them. The code listed below will show... (7 Replies)
Discussion started by: jcllns1
7 Replies

9. UNIX for Beginners Questions & Answers

Grep command in a loop

Hello - I am running a script that is outputting to a log. Let call it output.log I would like to monitor that log until the line "Build Successful" is found. I think I would need to use the grep command. How would I do that in a loop? Thanks Marty (1 Reply)
Discussion started by: MSpeare
1 Replies

10. Shell Programming and Scripting

Ps ax with grep in loop

Hello, I have built the following script to check if processes supplied by the argument are running or not. #!/bin/bash PROCLIST=$1 PROCESS="0" ERROR_PROCS="" IFS='+' read -ra ADDR <<< "$PROCLIST" for PROC in "${ADDR}"; do if ; then PROCESS=1 ... (9 Replies)
Discussion started by: nms
9 Replies
BHYVELOAD(8)						    BSD System Manager's Manual 					      BHYVELOAD(8)

NAME
bhyveload -- load a FreeBSD guest inside a bhyve virtual machine SYNOPSIS
bhyveload [-c cons-dev] [-d disk-path] [-e name=value] [-h host-path] [-m mem-size] vmname DESCRIPTION
bhyveload is used to load a FreeBSD guest inside a bhyve(4) virtual machine. bhyveload is based on loader(8) and will present an interface identical to the FreeBSD loader on the user's terminal. The virtual machine is identified as vmname and will be created if it does not already exist. OPTIONS
The following options are available: -c cons-dev cons-dev is a tty(4) device to use for bhyveload terminal I/O. The text string "stdio" is also accepted and selects the use of unbuffered standard I/O. This is the default value. -d disk-path The disk-path is the pathname of the guest's boot disk image. -e name=value Set the FreeBSD loader environment variable name to value. The option may be used more than once to set more than one environment variable. -h host-path The host-path is the directory at the top of the guest's boot filesystem. -m mem-size [K|k|M|m|G|g|T|t] mem-size is the amount of memory allocated to the guest. The mem-size argument may be suffixed with one of K, M, G or T (either upper or lower case) to indicate a multiple of Kilobytes, Megabytes, Gigabytes or Terabytes respectively. The default value of mem-size is 256M. EXAMPLES
To create a virtual machine named freebsd-vm that boots off the ISO image /freebsd/release.iso and has 1GB memory allocated to it: bhyveload -m 1G -d /freebsd/release.iso freebsd-vm To create a virtual machine named test-vm with 256MB of memory allocated, the guest root filesystem under the host directory /user/images/test and terminal I/O sent to the nmdm(4) device /dev/nmdm1B bhyveload -m 256MB -h /usr/images/test -c /dev/nmdm1B test-vm SEE ALSO
bhyve(4), nmdm(4), vmm(4), bhyve(8), loader(8) HISTORY
bhyveload first appeared in FreeBSD 10.0, and was developed at NetApp Inc. AUTHORS
bhyveload was developed by Neel Natu <neel@FreeBSD.org> at NetApp Inc with a lot of help from Doug Rabson <dfr@FreeBSD.org>. BUGS
bhyveload can only load FreeBSD as a guest. BSD
January 7, 2012 BSD
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy