i have a file called motors with 3 columns separated with tabs eg:
car make reg
i want to create a executable file that will add a line with data eg:
car make reg
benz s600 t35778
can you please show me how to do this? (7 Replies)
Hi all,
I need help to add additional data from file2 to existing data in file 1 using awk, sed or perl. the ID in file 1 should match against field $3 in file2
file1
#this is a new game
ID HR_1
BASE1 30
BASE2 37
DETAIL No
TYPE L
@@
ID HR_10
BASE1 6030
BASE2 ... (4 Replies)
Hi All
I need to add a column on my existing data file. I know similar posts are there but none of them were meeting my requirement. My input is
1.20 3.44 4.88
5.11 4.99 3.22
1.89 3.89 2.90
Desired output
1 1.20 3.44 4.88
2 5.11 4.99 3.22
3 1.89 3.89 2.90
I will... (2 Replies)
Hi Guys,
I have file A.txt
File A Data
AK1521
AK2536
AK3164
I want create text file of all data above and write some data on each file.
want Output on below folder
/home/kka/out
AK1521.txt
Hi
Welocme (3 Replies)
Hi,
I have a data file with :
01/28/2012,1,1,98995
01/28/2012,1,2,7195
01/29/2012,1,1,98995
01/29/2012,1,2,7195
01/30/2012,1,1,98896
01/30/2012,1,2,7083
01/31/2012,1,1,98896
01/31/2012,1,2,7083
02/01/2012,1,1,98896
02/01/2012,1,2,7083
02/02/2012,1,1,98899
02/02/2012,1,2,7083
I... (1 Reply)
Hi, I was wondering if someone would be able to help with extrapolating information from a file and filling an existing matrix with that information.
I have made a matrix like this (file 1):
A B C D
1
2
3
4
I have another file with data like this (file 2):
1 A
1 C
3 C
4 B... (1 Reply)
Hi all,
I need help for solve my problem.
my problem is like this..
i want to add many word to file. but after I add 1 word, the second word should be in the under of the first word.
i have tried but the result is like this
word1word2word3
i want the result to be like this
word1
word2... (5 Replies)
Discussion started by: weslyarfan
5 Replies
LEARN ABOUT NETBSD
flock
FLOCK(1) BSD General Commands Manual FLOCK(1)NAME
flock -- Provide locking API for shell scripts
SYNOPSIS
flock [-dnosvx] [-w timeout] lockfile|lockdir [-c command] | [command ...]
flock [-dnsuvx] [-w timeout] lockfd
DESCRIPTION
The flock utility provides flock(2) access to the command line or scripts. The first form locks a file or directory while the command pro-
vided is executed. If the file or directory does not exist, then a file is created.
The second form can use an arbitrary file descriptor that is provided from a shell script for example:
(
flock -s 100
# commands to be executed under the lock
) 100> /path/to/lockfile
The following options are available:
-c command Pass a command to a the shell.
-d, --debug Provide debugging output.
-n, --nb, --nonblock
Don't block and fail immediately if the lock could not be obtained.
-o, --close Close the file before executing the command. This is useful if the child forks and should not be holding the lock.
-s, --shared Obtain a shared lock.
-u, --unlock Unlock an existing lock. This is available only for a file descriptor.
-v, --verbose On error print an explanation of the failure.
-w, --wait, --timeout seconds
Fail if the lock could not be obtained after seconds.
-x, --exclusive Obtain an exclusive lock.
EXIT STATUS
The flock utility exits 0 on success, and >0 if an error occurs.
SEE ALSO shlock(1), flock(2)HISTORY
An flock utility appeared in NetBSD 6.1.
BSD November 2, 2012 BSD