11-27-2011
Quote:
Originally Posted by
jdsony
if possible could you please explain the command. it works but i don't understand it properly.
The parentheses cause all of the commands to be run in a sub-shell. As such, the standard output from all of the commands goes to the same place so
(command1; command2) >file nicely writes all of the output with the header line as you wanted. The
&& causes the next command on the line to be executed only if the previous command (the sub-shell) executed and returned a good return code. Thus, the move command is run only if the tmp file was successfully created. This prevents overlaying the original file with potentially bad data in the tmp file if the command failed. This is important if the data is difficult to, or cannot be, recreated.
Hope this helps you understand.
10 More Discussions You Might Find Interesting
1. Linux
say i have these many file in a directory named exam.
1)/exam/newfolder/link.txt.
2)/exam/newfolder1/
and i create a tar say exam.tar
well the problem is,
when i read the tar file i dont find any metadata about the directories,as you cannot create a tar containig empty directories.
on the... (2 Replies)
Discussion started by: Tanvirk
2 Replies
2. Shell Programming and Scripting
Please I am new to Unix and this simple question I am already answered but struggling to find the answer.
I have a data file which contains header record which conatins date timestamp. I need to find a way of simply updating the date time stamp to current date timestamp.
So if the header... (5 Replies)
Discussion started by: mudi
5 Replies
3. Shell Programming and Scripting
Hi Experts,
In our project we have requirement where in we have to compare header of one file with header in the parameter file.
There are 20 files which we ftp from one site. All this files have different header.
We are comapring this file with our parameter file(which is having the header... (2 Replies)
Discussion started by: Amey Joshi
2 Replies
4. Shell Programming and Scripting
Hi,
I've a file in the following format
1999-APR-8 17:31:06 1500 3 45
1999-APR-8 17:31:15 1500 3 45
1999-APR-8 17:31:25 1500 3 45
1999-APR-8 17:31:30 1500 3 45
1999-APR-8 17:31:55 1500 3 45
1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I am new to unix programming. I am trying for a requirement and the requirement goes like this.....
I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies
6. UNIX for Dummies Questions & Answers
Friends,
I need help with the following in UNIX.
Merge all csv files in one folder considering only 1 header row and ignoring header of all other files.
FYI - All files are in same format and contains same headers.
Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies
7. Shell Programming and Scripting
Hi Friends,
I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only
I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies
8. Shell Programming and Scripting
Hello
I am facing a very unique problem and not able to understand why. I have written a function which will check header of the file. If header is present good else it will write the header on top
def writeHeaderOutputCSV(fileName):
# See if the file exist already
try:
... (0 Replies)
Discussion started by: radioactive9
0 Replies
9. Shell Programming and Scripting
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Discussion started by: verdepollo
3 Replies
10. Programming
First, I want to thank Neo (LOL) for this post from 2018, Node.js and mysql - ER_ACCESS_DENIED_ERROR
I could not get the Node-RED mysql module to work and searched Google until all my links were purple! I kept getting ER_ACCESS_DENIED_ERROR with the right credentials. Nothing on the web was... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT NETBSD
shmif_dumpbus
SHMIF_DUMPBUS(1) BSD General Commands Manual SHMIF_DUMPBUS(1)
NAME
shmif_dumpbus -- examine shmif bus contents
SYNOPSIS
shmif_dumpbus [-h] [-p pcapfile] busfile
DESCRIPTION
The shmif_dumpbus utility examines the bus of an shmif(4) Ethernet interface. The most useful feature is converting the bus to the pcap(3)
file format for later examination. shmif_dumpbus itself is limited to displaying only very basic information about each frame.
shmif_dumpbus accepts the following flags:
-h Print bus header only and skip contents.
-p pcapfile Convert bus contents to the pcap(3) format and write the result to pcapfile. The file - signifies stdout.
EXAMPLES
Feed the busfile contents to pcap:
$ shmif_dumpbus -p - busfile | tcpdump -r -
SEE ALSO
pcap(3), shmif(4), tcpdump(8)
CAVEATS
shmif_dumpbus does not lock the busfile and is best used for post-mortem analysis of the bus traffic.
The timestamp for each frame contains the sender's timestamp and may not be monotonically increasing with respect to the frame order in the
dump.
BSD
January 12, 2011 BSD