10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
By using sed command, How to insert a new line before the last four lines of the file.
Old Line
Old Line
NEW LINE!
Old Line
Old Line
Old Line
Old Line (8 Replies)
Discussion started by: wridler
8 Replies
2. Shell Programming and Scripting
I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string.
Line repeating working every 3 lines using code:
sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt
I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies
3. Red Hat
Hi,
I have two ntp servers in my cluster and I want all the nodes in my cluster to sync with either of the ntp servers or just one. Unfortunately it keep rotating the sync, between my ntp server 1, ntp server 2 and local. Is there anyway I can change the sync to avoid local?
# ntpq -p
... (3 Replies)
Discussion started by: pjeedu2247
3 Replies
4. Shell Programming and Scripting
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Discussion started by: JolietJake
2 Replies
5. Shell Programming and Scripting
Hi, I have text file:
Name: xyz
Gender: M
Address: "120_B_C; ksilskdj; lsudlfw"
Zip: 20392
Name: KLM
Gender: F
Address: "65_D_F; wnmlsi;lsuod;,...."
Zip:90233I want to insert 2 new lines before the 'Address: ' line deriving value from this Address line value
The Address value in quotes... (1 Reply)
Discussion started by: ysrini
1 Replies
6. Shell Programming and Scripting
Hello,
I have a file that I want to be able to insert a new line before every instance of a regex. I can get it to do this for each line that contains the regex, but not for each instance.
Contents of infile:
Test this 1...
Test this 2...
Test this 3... Test this 4... Test this... (2 Replies)
Discussion started by: deneuve01
2 Replies
7. Shell Programming and Scripting
I have following pattern in a file:
00:01:38 UTC
abcd
00:01:48 UTC
00:01:58 UTC
efgh
00:02:08 UTC
00:02:18 UTC
and I need to change something like the following
00:01:38 UTC
abcd
00:01:48 UTC
XXXX
00:01:58 UTC
efgh
00:02:08 UTC
XXXX (6 Replies)
Discussion started by: jjnight
6 Replies
8. HP-UX
Hi
I wonder if its possible to setup NTP clients running HP-UX o.s. from a solaris 10 NTP server?
FR (3 Replies)
Discussion started by: fretagi
3 Replies
9. Shell Programming and Scripting
Hello,
I am trying to write a script that will count the number of characters for each line in a file and all the lines that have less than 80 characters and that are ending with a period, I want it to insert a blank line after them immediately. But, for whatever reason the condition if ]] is... (3 Replies)
Discussion started by: Pouchie1
3 Replies
10. Red Hat
I've got two suites. Both suites have servers with a ntp.conf and step-tickers file. Both suites are running fine with respect to time. One suite of servers has empty step-ticker files, the other one has content in the files.
Do I need both files? Should the files be populated? Should the two... (1 Reply)
Discussion started by: scottwevans
1 Replies