The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-01-2008
jim mcnamara jim mcnamara is offline
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,851
Code:

awk '{ printf("!\ninterface %s\n%s\n%s\n", $0, " no shut", " switchport mode access")}' file1.txt
Quote:
!
GigabitEthernet1/1
no shut
switchport mode access
!
GigabitEthernet1/2
no shut
switchport mode access
!
GigabitEthernet2/2
no shut
switchport mode access
!
GigabitEthernet2/4
no shut
switchport mode access
!
GigabitEthernet2/14
no shut
switchport mode access
!
GigabitEthernet2/16
no shut
switchport mode access

Last edited by jim mcnamara; 05-01-2008 at 09:03 AM.
Reply With Quote