Sponsored Content
Full Discussion: Merge all commands into one
Top Forums Shell Programming and Scripting Merge all commands into one Post 302357630 by Amit.Sagpariya on Wednesday 30th of September 2009 09:24:43 AM
Old 09-30-2009
Merge all commands into one

how can i merge follwoing process to one...

Code:
tail +5 rawdata_AAA_1.txt_$$ | grep -v "^$" >> rawdata_AAA_2.txt_$$

For discarding first 5 rows and deleting null rows
Code:
awk '!/^ /{if(a) print a; a=$0}/^ /{print a}' rawdata_AAA_2.txt >> rawdata_AAA_3.txt

For merging record if it split into 2 rows
Code:
awk '$2 != "" {print}' rawdata_AAA_3.txt_$$ | sort | uniq  >> rawdata_AAA_4.txt_$$

For sorting and removing duplicate data
Code:
awk '{print "AAA "$0}' rawdata_AAA_4.txt >> final_rawdata.txt

For adding column at first in the file..

How can i club all this process into one command?
 

10 More Discussions You Might Find Interesting

1. Programming

code that reads commands from the standard i/p and executes the commands

Hello all, i've written a small piece of code that will read commands from standard input and executes the commands. Its working fine and is execting the commands well. Accepting arguments too. e.g #mkdir <name of the directory> The problem is that its not letting me change the directory i.e... (4 Replies)
Discussion started by: Phrozen Smoke
4 Replies

2. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

3. UNIX for Dummies Questions & Answers

awk simple commands merge

Is there nice awk code for merging the following commands and do the last task? input1 ab100 xxx 100 blahblah + 1000 ab100 yyy 90 blahblah + 1000 ef390 ggg 200 blahblah - 2000 ef390 aaa 100 blahblah - 2000 df888 ttt 300 ... (5 Replies)
Discussion started by: ruby_sgp
5 Replies

4. Shell Programming and Scripting

merge files

hi, i've two files whcih i need to merge in below format. File1- DEFINE lc_driver CHAR(3) INITIALIZE gr_XXX_MAIN_TABLE_XXX.* TO NULL { EXECUTE p_XXX_MAIN_TABLE_XXX_ins USING gr_XXX_MAIN_TABLE_XXX.* } File2 - # field1 LET table1.field1= (8 Replies)
Discussion started by: dvah
8 Replies

5. Shell Programming and Scripting

merge two file

how to merge two file, i have 2 input file; file_1 & file_2, so i want the output file_3 as below file_1 NAME aa 111 222 bb.txt 111 222 cc 111 111 dd 222 ee 111 222 (4 Replies)
Discussion started by: zulabc
4 Replies

6. AIX

HACMP: difference between 'cl' commands and 'cli' commands

Hi all, I'm new in this forum. I'm looking for the difference between the HACMP commands with the prefix "cl" and "cli". The first type are under /usr/es/sbin/cluster/sbin directory and the second are under /usr/es/sbin/cluster/cspoc directory. I know that the first are called HACMP for AIX... (0 Replies)
Discussion started by: peppix
0 Replies

7. UNIX for Advanced & Expert Users

How to merge two commands

I have input like Unload: 2610000 225 2198 374 315 420 1149 57 2611 595 662 374 820 130 2938 486 2483 397 760 using these values, i need to divide first number with second number, means 225/2198, and using the value i'm trying to sort it. After sort i need first and "Unload" values,... (2 Replies)
Discussion started by: arivu198314
2 Replies

8. Shell Programming and Scripting

Merge output of 2 commands into variable

I am extracting two pieces of information from the following file: /proc/cpuinfo, that I need to merge into one report. The first command: grep -i processor /proc/cpuinfo | awk '{print $1$2,$3}' yields: processor: 0 processor: 1 processor: 2 processor: 3 The second command: grep -i... (4 Replies)
Discussion started by: jamarsh
4 Replies

9. Shell Programming and Scripting

How to merge two files?

Hi Gurus, I have two files as below file1 abc cde cdd cdf file2 123 234 345 456 I want to get abc 123 cde 234 cdd 345 (3 Replies)
Discussion started by: ken6503
3 Replies

10. Programming

Merge .lo into .so

Good day to everyone. I've built an libxml2 from sources. I can not install it in a proper way with using repository due to I have not sudo privilegies. I've got a set of .lo files. Is there a simple way to merge it in one .so or .a file? (2 Replies)
Discussion started by: z7ql
2 Replies
DH_INSTALLDEB(1)						     Debhelper							  DH_INSTALLDEB(1)

NAME
dh_installdeb - install files into the DEBIAN directory SYNOPSIS
dh_installdeb [debhelperoptions] DESCRIPTION
dh_installdeb is a debhelper program that is responsible for installing files into the DEBIAN directories in package build directories with the correct permissions. FILES
package.postinst package.preinst package.postrm package.prerm These maintainer scripts are installed into the DEBIAN directory. Inside the scripts, the token #DEBHELPER# is replaced with shell script snippets generated by other debhelper commands. package.triggers package.shlibs These control files are installed into the DEBIAN directory. Note that package.shlibs is only installed in compat level 9 and earlier. In compat 10, please use dh_makeshlibs(1). package.conffiles This control file will be installed into the DEBIAN directory. In v3 compatibility mode and higher, all files in the etc/ directory in a package will automatically be flagged as conffiles by this program, so there is no need to list them manually here. package.maintscript Lines in this file correspond to dpkg-maintscript-helper(1) commands and parameters. However, the "maint-script-parameters" should not be included as debhelper will add those automatically. Example: # Correct rm_conffile /etc/obsolete.conf 0.2~ foo # INCORRECT rm_conffile /etc/obsolete.conf 0.2~ foo -- "$@" In compat 10 or later, any shell metacharacters will be escaped, so arbitrary shell code cannot be inserted here. For example, a line such as "mv_conffile /etc/oldconffile /etc/newconffile" will insert maintainer script snippets into all maintainer scripts sufficient to move that conffile. It was also the intention to escape shell metacharacters in previous compat levels. However, it did not work properly and as such it was possible to embed arbitrary shell code in earlier compat levels. The dh_installdeb tool will do some basic validation of some of the commands listed in this file to catch common mistakes. The validation is enabled as a warning since compat 10 and as a hard error in compat 12. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLDEB(1)
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy