Sponsored Content
Top Forums UNIX for Advanced & Expert Users Add new lines with a space in beginning Post 302191056 by Aejaz on Thursday 1st of May 2008 11:13:26 AM
Old 05-01-2008
Add new lines with a space in beginning

Hi

file1.txt contains

GigabitEthernet1/1
GigabitEthernet1/2
GigabitEthernet2/2
GigabitEthernet2/4
GigabitEthernet2/14
GigabitEthernet2/16

can anyone show me how to modify it as below. there is a space at the beginning of the next two lines . ie 'no shut' and 'switch..'

!
interface GigabitEthernet1/1
no shut
switchport mode access
!
GigabitEthernet1/2
no shut
switchport mode access
!

.
.
.
.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete lines from file2 beginning w/file1

I've been searching around here and other places, but can't put this together... I've got a unique list of words in file 1 (one word on each line). I need to delete each line in file2 that begins with the word in file1. I started this way, but want to know how to use file1 words instead... (13 Replies)
Discussion started by: michieka
13 Replies

2. Shell Programming and Scripting

grep - to exclude lines beginning with pattern

11132 13069 11137 11142 13070 Can I use grep command to exclude all lines beginning with 13? I dont want to use grep -v 13 as potentially there will be a number with something like 11013 that I would exclude in error.. (2 Replies)
Discussion started by: frustrated1
2 Replies

3. Shell Programming and Scripting

Adding words to beginning of lines

I have a file that contains a great number of lines, let's say 183 lines, and I want to add: echo " to the beginning of each line. What is the easiest way to do it? Tx (9 Replies)
Discussion started by: Ernst
9 Replies

4. Shell Programming and Scripting

Remove white space at the beginning of lines

Hi! I store some data obtained with grep or awk in a file. The problem is that some lines have white space at the begining : line1 line2 line3 I use something like grep WORD INFILE >> OUTFILE awk >> OUTFILE I would love if it were possible to remove the white whitout parsing the... (4 Replies)
Discussion started by: tipi
4 Replies

5. Shell Programming and Scripting

Swapping lines beginning with certain words using sed/awk

I have a large file which reads like this: fixed-address 192.168.6.6 { hardware ethernet 00:22:64:5b:db:b1; host X; } fixed-address 192.168.6.7 { hardware ethernet 00:22:64:5b:db:b3; host Y; } fixed-address 192.168.6.8 { hardware ethernet 00:22:64:5b:db:b4; host A; }... (4 Replies)
Discussion started by: ksk
4 Replies

6. Solaris

deleting blank space in beginning of line in vi

How can we delete all the blank spaces in the beginning of some lines in a text in vi? Thanks, (2 Replies)
Discussion started by: Pouchie1
2 Replies

7. Shell Programming and Scripting

Extract lines between 2 strings add white space

I'm trying to extract all the lines between 2 strings (including the lines containing the strings) To make the strings unique I need to include white space if possible. I'm not certain how to do that. sed -n '/ string1 /,/string2/p' infile > outfile & (4 Replies)
Discussion started by: dcfargo
4 Replies

8. Shell Programming and Scripting

Space at beginning of the line

How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies

9. Shell Programming and Scripting

SED - insert space at the beginning of line and multi replace command

hi I am trying to use SED to replace the line matching a pattern using the command sed 'pattern c\ new line ' <file1 >file 2 I got two questions 1. how do I insert a blank space at the beginning of new line? 2. how do I use this command to execute multiple command using the -e... (5 Replies)
Discussion started by: piynik
5 Replies

10. Shell Programming and Scripting

Insert at the beginning of odd lines

Hello people, I am trying with sed to insert some text at the beginning of each odd line of a file but no luck. Can you please help. Awk is also suitable but I am not very familiar with it. Thank you in advance for any help. (7 Replies)
Discussion started by: drbiloukos
7 Replies
LAMHALT(1)							     LAM TOOLS								LAMHALT(1)

NAME
lamhalt - Shutdown the LAM/MPI run-time environment. SYNOPSIS
lamhalt [-dhHv] OPTIONS
-d Turn on debugging mode. This implies -v. -h Print the command help menu. -i Return immediately (even before the LAM universe is fully halted); deprecated -H Suppress printing the header message. -v Be verbose. DESCRIPTION
The lamhalt tool terminates the LAM software on each of the nodes that were initially booted with lamboot and/or lamgrow. No additional command line arguments are necessary - lamhalt simply sends a message to each remote node telling it to shut down. Each remote node invokes tkill(1) locally to shut down. See tkill(1) for a description of how LAM is terminated on each node. lamhalt may fail if one of the remote nodes has failed, and does not respond to lamhalt's queries. In this case, the lamwipe(1) command should be used to shut down LAM/MPI. If lamwipe(1) fails, the user can manually invoke tkill(1) on the troubled node. In extreme cases, the user may have to terminate individual LAM processes with kill(1). Older versions of lamhalt would return 1-3 seconds before the entire LAM universe was shut down. This caused problems for some LAM users, particularly those who had scripts that invoked lamboot immediately after lamhalt. lamhalt has therefore been changed to wait until the entire LAM universe is down before exiting. This makes the execution of lamhalt take a few seconds (typically less than 5). For users who want the old lamhalt behavior, use the -i (or "immediate") switch, which will cause lamhalt to return immediately, likely before the entire LAM universe has been taken down. EXAMPLES
lamhalt -d Shutdown LAM on the machines and be verbose about its actions. SEE ALSO
recon(1), lamboot(1), tkill(1), bhost(5), lam-helpfile(5), lamwipe(1) LAM 7.1.4 July, 2007 LAMHALT(1)
All times are GMT -4. The time now is 01:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy