The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to concatenate several files docaia Shell Programming and Scripting 3 02-03-2008 09:07 AM
Concatenate text of two files in UNIX. Uniq UNIX for Advanced & Expert Users 1 01-19-2007 07:53 AM
Dvd files concatenate error: Not enough space maag SUN Solaris 3 05-06-2006 11:39 PM
How to concatenate all files. s80bob UNIX for Dummies Questions & Answers 1 08-22-2005 05:20 PM
Split n then concatenate files. praveen.pinto UNIX for Advanced & Expert Users 4 02-16-2005 12:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-11-2008
pdtak pdtak is offline
Registered User
  
 

Join Date: Feb 2008
Location: Sacramento
Posts: 33
How to concatenate 2 files using awk?

I have to select a field ($8) from file1, then add an entry to the file2 in the correct format:

/tmp> cat file1
3001-233 Invalid admin value in /etc/security/group for "imnadm"
3001-233 Invalid admin value in /etc/security/group for "perfmon"
3001-233 Invalid admin value in /etc/security/group for "extract"
3001-233 Invalid admin value in /etc/security/group for "vality"
3001-233 Invalid admin value in /etc/security/group for "profadm"
3001-233 Invalid admin value in /etc/security/group for "db2asgrp"
3001-233 Invalid admin value in /etc/security/group for "db2adm"

/tmp> cat file2
system:
admin = true
staff:
admin = false
bin:
admin = true

Any ideas?

Thanks.
  #2 (permalink)  
Old 03-11-2008
ShawnMilo ShawnMilo is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 252
This should work:


Code:
{ cat file1.txt  | cut -d " " -f 8; cat file2.txt; }

Note: The semi-colon and space before the closing curly-brace are both required.
  #3 (permalink)  
Old 03-12-2008
pdtak pdtak is offline
Registered User
  
 

Join Date: Feb 2008
Location: Sacramento
Posts: 33
Thanks Shawn!

Thanks Shawn! I'll try that.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0