Sponsored Content
Full Discussion: need Script logic
Top Forums Shell Programming and Scripting need Script logic Post 302514116 by rdcwayx on Thursday 14th of April 2011 10:06:52 PM
Old 04-14-2011
Code:
awk 'NR==FNR{a[$6]=(a[$6]=="")?$2 OFS $4 OFS $NF:a[$6] RS OFS OFS $2 OFS $4 OFS $NF;next} 
   {print $1,($1 in a)?a[$1]:X}' FS=, OFS="\t" All.csv sc.txt

ecf0183.sh
ecf1002.sh      ecf1002 pcor1   ECF-D-LND-AMZ-A
                ecf1002a        pcor1   ECF-D-LND-AX-A
ecf1011.sh      ecf1011ab       pcor1   EW-G-LND-AX-A
ecf1020.sh      ecf1020rt       pcor1   EW-G-JYD-GEX-D

 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script logic

Please help me to write the following script. 1) Input files will be in Test directory. (Test/YYYY/MM) folders (Ex: 1) 2010/ 01 2) 2011/05) The file name will be Testfile1_6676543218_Axxxxxxyyyyyzzzzzzzzzzzzzzzzzz.pdf.gz 2) The compare file will be in /tmp directory. (/tmp/comparefile.txt). The... (6 Replies)
Discussion started by: mnjx
6 Replies

2. Shell Programming and Scripting

Need script logic

i have two csv files (rates.csv, reference.csv) as below. rates.csv contains Code, respective Zone details rates.csv ---------- 23,38Nhava 45,37NEWYORK 89,SHILANG 71,ROBACCA reference.csv contains all Zone details reference.csv ------------- 37Newyork robacca 38Nhava... (5 Replies)
Discussion started by: p_satyambabu
5 Replies
AMANDA-SCRIPTS(7)						    Miscellanea 						 AMANDA-SCRIPTS(7)

NAME
amanda-scripts - Configuring and using the Script API DESCRIPTION
The Script API is a flexible system for invoking user-supplied scripts at various points in the execution of Amanda. This manual page describes the operation and configuration of the API. For help writing Script API scripts, see http://wiki.zmanda.com/index.php/Script_API. SCRIPTS
This section lists the scripts included with Amanda, see the individual man page for instructions on using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. o amzfs-snapshot(8), - create/destroy zfs snapshot. o script-email(8), - send email. Script properties work just like application properties: they are insensitive to case, and - (dash) and _ (underscore) may be used interchangeably. SCRIPTS OUTPUT PROPERTY
A pre-dle-amcheck, pre-dle-estimate or pre-dle-backup executed on the client can output property on stdout that are sent to the application. If the output line matches "PROPERTY str1 str2", Amanda sets a property called "str1" by the value of "str2", that property is sent to the application. SEE ALSO
amanda(8), amanda.conf(5) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
Jean-Louis Martineau <martineau@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Dustin J. Mitchell <dustin@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Amanda 3.3.1 02/21/2012 AMANDA-SCRIPTS(7)
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy