Sponsored Content
Operating Systems Linux Red Hat Remove new line for a particular place Post 302945953 by Sandeep_sandy on Friday 5th of June 2015 05:14:46 AM
Old 06-05-2015
Quote:
Originally Posted by Don Cragun
You mean something like:
Code:
awk '($0 ~ /^1234/){S=$0;getline;print S $0;S="";next} 1' test199 > x$$ && cp x$$ test199; rm -f x$$

Thanks Don, this command indeed works but now I am getting a ^M (carriage return) at that place.

1234,5678,fasfasasfsadf
abc

turns to

1234,5678,fasfasasfsadf^Mabc
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to place the output of two different echo statements on one line

Hello there, I wrote a shell script to modify the code for some of our clients in our client database. Before starting the data modification the program performs a few checks. When a check is being performed, it should be shown on the screen of the user running the program, the result of... (5 Replies)
Discussion started by: JoBa
5 Replies

2. Shell Programming and Scripting

Getting the value of a line, that changes place

Hi I am trying to get the value of several results in a file called seq032.diag. The values I am looking for is down under Smooth Tracking nodes and is for g01r01 g02r01 s01t02 etc etc. The problem is that when I try to use look for text and tail etc, it works fine in one result file. In... (1 Reply)
Discussion started by: Navigatorchief
1 Replies

3. Shell Programming and Scripting

SED: Place char at starting and replace selected line

Hello Experts, I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn. AIM: The script has some commented and some uncommented lines. I need to : ... (2 Replies)
Discussion started by: hkansal
2 Replies

4. Shell Programming and Scripting

howto place in one line output from two functions

Hi I would like to place in one line output from two functions. Both functions return text with print cmd. When I place above code in script it will place them in series. e.g. 1 #/bin/ksh 2 3 function1() 4 { 5 print "My name is" 6 ... (3 Replies)
Discussion started by: presul
3 Replies

5. Shell Programming and Scripting

Place variables at the beginning of each line

Hello all, I am very new to the shell scripting and I hope someone can help me with this. I have thousands of files with certain format of information and I need to do this for all my files. For each file, grab the numbers in the first and second rows and place them in the position 1 and 2... (8 Replies)
Discussion started by: GoldenFire
8 Replies

6. Shell Programming and Scripting

script for inserting line at specific place in file

I use zentyal for my server admin, which is great but zentyal auto-generates config file on boot and hence overwrites any changes made directly to config files. In order to allow multiple user access to a MS ACCESS database, I need to customise the smb.conf file and add the following line to the... (9 Replies)
Discussion started by: barrydocks
9 Replies

7. Shell Programming and Scripting

script to find backshash and place the content in next line

Hi All, I am new to the forum and scripting...Can someone help me with a code.. My input file will be like $cat first aa a\b bb\ccccc\ddd ee*e\fff\ggg output should be aa a\ b bb\ ccccc\ ddd ee*e\ fff\ ggg I tried with cat first | awk '{ gsub( /\\/, "/\\/" );... (5 Replies)
Discussion started by: madhanmo
5 Replies

8. Shell Programming and Scripting

Copy a field into n line in another place

I have a file contains 100 section (here i show 2 section of that); i want to replace date from 1st & 2nd field of 1st line of each section (1st line of each section is header and the other lines are body) and merg them into one field, then copy it on 7th field of the lines in each section... (17 Replies)
Discussion started by: oreka18
17 Replies

9. Shell Programming and Scripting

Find regex, place on individual lines and insert blank line before

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

10. Shell Programming and Scripting

Add line in exact place

I have one big XML file which contains information about 100 jobs,"JOB JOBISN=" indicates that is a job so where ever tag starts with "JOB JOBISN=" then i need to add below highlighted line between "<INCOND NAME" and "<OUTCOND NAME" for all jobs.like this i want to add below highlighted line for... (7 Replies)
Discussion started by: katakamvivek
7 Replies
ESSIDSCAN(8)							     Commands							      ESSIDSCAN(8)

NAME
essidscan - scan for ESSID corresponding to available WLAN access points SYNOPSIS
In /etc/network/interfaces: mapping <interface> script essidscan DESCRIPTION
The essidscan utility is used to tell the ifup and ifdown utilities about the current SSID of the WLAN currently being accessed. It can be used to map the SSID name to an iface stanza. CONFIGURATION
A sample /etc/network/interfaces may look like this: mapping hotplug script /etc/network/essidscan map SSIDONE wlan-work map SSIDTWO wlan-work map HOME iface wlan-work inet dhcp wireless-key 1234-5678-9ABC-DEF0-1234-5678-9A wireless-keymode restricted iface HOME inet static address 192.168.2.4 netmask 255.255.255.0 gateway 192.168.2.1 wireless-essid HOME wireless-key s:somepassword wireless-keymode open iface DEFAULT inet dhcp FILES
/etc/network/interfaces the interfaces definition file /etc/network/run/ifstate a record of the current state of the interfaces, managed by ifup and ifdown SEE ALSO
interfaces(5) ifscheme(8) ifup(8) ifdown(8) AUTHORS
Tor Slettnes <tor@slett.net> ESSIDSCAN(8)
All times are GMT -4. The time now is 06:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy