In the [[...]] construct, the word following -f has to be a file-name path and not a pattern for a file-name path. -f will treat your provided pattern as a literal file-name and the other statement will not get executed.
An alternative to get what you want could be:
I am assuming only one file in the directory with that pattern or none.
If multiple files or directories with that pattern may exist and if you are not averse to using a simple loop, you may try:
Last edited by elixir_sinari; 08-27-2012 at 05:38 AM..
Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match.
I'm stuck in an AWK... (9 Replies)
Hello Guyz
I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline
ABC
DEF
LMN
EFG
HIJ
LMN
OPQ
In the above text i need to... (8 Replies)
Hi,
I am writing a shell script to parse some files, and gather data.
The data in the files is displayed as below.
.......xyz: abz: ......
.......xyz: abz: .....
I have tried using awk and cut, bu the position of these values keep changing, so I can use awk and split it into columns. ... (14 Replies)
Hi experts , im new to Unix,AWK ,and im just not able to get this right.
I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
I have an application(Minecraft Server) that generates a logfile live. Using Crontab and screen I send a 'list' command every minute.
Sample Log view:
2013-06-07 19:14:37 <Willrocksyea1> hello*
2013-06-07 19:14:41 <Gromden29> hey
2013-06-07 19:14:42 Gromden29 lost connection:... (1 Reply)
Ive used this snippet of code on a solaris box thousands of times.
But it isnt working on the new linux box
sed -n '/interface LoopBack0/{N;/ ip address /p;}' *.conf
its driving me nuts !!
Is there something Im missing ? (7 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
LEARN ABOUT REDHAT
lvmcreate_initrd
LVMCREATE_INITRD(8) System Manager's Manual LVMCREATE_INITRD(8)NAME
lvmcreate_initrd - create an initial ramdisk to boot with root on a logical volume
SYNOPSIS
lvcmreate_initrd [-i|--iop IOP] [-D|--devfs] [-v|--verbose] [-V|--version] [KernelVersion]
DESCRIPTION
lvmcreate_initrd creates a new compressed initial ramdisk /boot/initrd-lvm-KernelVersion.gz. The initial ramdisk contains all necessary
binaries, shared libraries and a linuxrc file to switch to a logical volume based root filesystem. To build an initial ramdisk for a ker-
nel other than the one currently running add the KernelVersion parameter (e.g. lvmcreate_initrd 2.3.25) on the command line.
OPTIONS
-h, --help
Print a usage message on standard output and exit.
-i, --iop IOP
Specify the LVM kernel IOP version if you are using wrapper scripts in /sbin. This is only necessary if you are building an initrd
for a kernel other than the current one, and you have tools for multiple IOP versions installed.
-D, --devfs
Force the use of devfs when building the initrd. lvmcreate_initrd by default probes for devfs by checking for /dev/.devfsd, which
is created by devfsd when it is running. This option will force lvmcreate_initrd to do this, when devfsd is not currently running.
-v, --verbose
Gives verbose runtime information about the creation of the ram disk image.
-V, --version
Print version number and exit successfully.
The necessary actions to change your system into a "root on logical volume" one are:
Create a small (~20MB) partition which is BIOS reachable to hold the /boot filesystem (if you already have a small partition based root
filesystem this can be used instead). If you want to boot standalone from this partition in an emergency, copy all the necessary binaries
and libraries to that filesystem as well and create a corresponding /etc/lilo.conf entry. In order to be able to edit lilo.conf when booted
standalone, you should move /etc/lilo.conf to /boot/lilo.conf and create a symbolic link to it in /etc. This is not needed if you have a
boot/root floppy which contains the LVM binaries and the library.
Create all logical volumes you need (for root, usr, opt etc.), create filesystems in them, mount them and transfer all files from the par-
tition based filesystems into the logical volume based ones.
Set up your /etc/lilo.conf with a boot configuration like:
image = /boot/vmlinuz
initrd = /boot/initrd-lvm-KernelVersion.gz
root = /dev/YourVG/YourRootLV
label = rootonlv
append = 'ramdisk_size=8192'
Replace YourVG and YourRootLV by your actual volume group and root logical volume names. You also need to change the ramdisk size to be at
least as large as that reported while lvmcreate_initrd is run. If you have enough memory, it is OK if the ramdisk size in /etc/lilo.conf
is larger than what lvmcreate_initrd reports (the memory is freed after booting). Also, your /etc/fstab in the root logical volume should
contain entries for the root LV, and the boot partition, along with any other LVs you have configured:
/dev/YourVG/YourRootLV / ext2 defaults 0 1
/dev/YourBootPartition /boot ext2 defaults 0 2
/dev/YourVG/YourUsrLV /usr ext2 defaults 0 3
/dev/YourVG/YourOptLV /opt ext2 defaults 0 4
etc.
You can use other supported filesystem types as well (e.g. reiserfs) if you have support for those in your kernel. Run lilo, reboot and
try...
The partitions containing the former /usr, /opt etc. filesystems can now be used as physical volumes. Use pvcreate(8) to turn them into
PVs and then use vgextend(8) to add them to e.g. YourVG.
DIAGNOSTICS
lvcmcreate_initrd returns 0 for success. 1 is returned in all other cases.
SEE ALSO lilo(8), lilo.conf(5), fstab(5), lvm(8), pvcreate(8), vgextend(8), lvcreate(8), vgcreate(8)AUTHOR
Heinz Mauelshagen <Linux-LVM@Sistina.com>
Heinz Mauelshagen LVM TOOLS LVMCREATE_INITRD(8)