Don't use double quotes around the filenames (i.e. file[12]) as they need to be expanded by the shell. Assuming a typo in your samples' first lines, I'd suggest "replacing field 1 in file 2 with field 2 in file 1 if both files' field 1 match":
I am trying to automate a process of searching through a set of files and replace all occurrences of a formatted text with the next item in the list of a second file. Basically i need to replace all instances of T????CLK???? with an IP address from a list in a second file. the second file is one IP... (9 Replies)
Hello,
I've never used awk before, but from what I've read, it will best suit what I'm trying to do. I have 2 files. I need to replace strings in file1 with the first column of a matching string in file2. Below are examples:
File1:
random-string1
1112
1232
3213
2131
random-string2... (7 Replies)
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hello,
I was hoping someone could help me with this work related problem...
basically what I want to do is the following:
file2:
1 o
2 t
4 f
5 v
7 n
8 e
10 a
file1:
1 : (8 Replies)
I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string.
I'm looking to match column1 in file1 to the number... (3 Replies)
I have file 1 & file 2 with content mentioned below. I want to get the output as shown in file3.
Requirement:
check the content of column 1 & column 2, if value of column 1 in file1 matches with first column of file2 then remaining columns(2&3) of file2 should get replaced, also if value of... (4 Replies)
Hello,
I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
I want to print only the lines in file2 that match file1, in the same order as they appear in file 1
file1
file2
desired output:
I'm getting the lines to match
awk 'FNR==NR {a++}; FNR!=NR && a' file1 file2
but they are in sorted order, which is not what I want:
Can anyone... (4 Replies)
I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited.
I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
In the awk below I am trying to set/update the value of $14 in file2 in
bold, using the matching NM_ in $12 or $9 in file2
with the NM_ in $2 of file1.
The lengths of $9 and $12 can be variable but what is consistent is the start pattern
will always be NM_ and the end pattern is always ;... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT DEBIAN
vlock-main
VLOCK-MAIN(8) Linux Programmer's Manual VLOCK-MAIN(8)NAME
vlock-main - lock current virtual console
SYNOPSIS
vlock-main [plugins...]
DESCRIPTION
vlock-main is part of vlock(1), the Virtual Console locking program for Linux. It locks the current session and will only exit if the cur-
rent user can authenticate themselves. The root user will also be able to unlock the session, unless disabled at compile time. The com-
mand line arguments specify plugins that should be loaded by vlock-main. See vlock-plugins(5) for more information.
If plugin support is disabled at compile time, the only supported argument is "all".
ENVIRONMENT VARIABLES
The following environment variables can be used to change the behavior of vlock-main:
USER
If this variable is when vlock-main is run as root (uid 0) vlock locks the screen as this user instead of root. The root password
will still be able to unlock the session, unless disabled at compile time.
VLOCK_ALL_MESSAGE
If this variable is set and all consoles are locked its contents will be used as the locking message instead of the default message.
VLOCK_CURRENT_MESSAGE
If this variable is set and only the current consoles is locked its contents will be used as the locking message instead of the
default message.
VLOCK_MESSAGE
If this variable is set its contents will be used as the locking message instead of the default. This overrides the former two
variables.
VLOCK_TIMEOUT
Set this variable to specify the timeout (in seconds) after which the screen saver plugins (if any) will be invoked. If this vari-
able is unset or set to an invalid value or 0 no timeout is used. See vlock-plugins(5) for more information about plugins.
VLOCK_PROMPT_TIMEOUT
Set this variable to specify the amount of time (in seconds) you will have to enter your password at the password prompt. If this
variable is unset or set to an invalid value or 0 no timeout is used. Warning: If this value is too low, you may not be able to
unlock your session.
SIGNALS
Several signals are ignored. vlock-main will try to exit cleanly if SIGTERM is received.
SEE ALSO vlock(1), vlock-plugins(5)AUTHORS
Frank Benkstein <frank-vlock@benkstein.net>
Linux 28 July 2007 VLOCK-MAIN(8)