Sponsored Content
Top Forums Shell Programming and Scripting Read file and add it into part of file Post 303016037 by vgersh99 on Wednesday 18th of April 2018 02:11:05 PM
Old 04-18-2018
one way:
Code:
awk -v qq='"' 'FNR==NR {f2=$0;next} /^allow_ports=/{sub(qq qq, qq f2 qq)}1' ports.txt main.conf

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

read in part of the file into another file

Hi, I justs started learning Unix on my own. I have a question: What command can I use when I need to read in part of the file into another file? I remember I saw it somewhere but I don't know what it is. Thanks (3 Replies)
Discussion started by: whatisthis
3 Replies

2. Shell Programming and Scripting

Add Date as part of file name

How can I add date in format yyyymmdd to my existing file name ? For example my file name is test.dat then i want it to be test.datyyyymmdd (3 Replies)
Discussion started by: amsh76
3 Replies

3. Shell Programming and Scripting

I'm trying to read from a file and add to LDAP

Hi all I'm trying to write a script that reads from a file and then insert the record by a command line tool into LDAP. here is the file format FirstName LastName uid password and here is the script that I wrot: #!/bin/sh INPUT='/export/home/user/input' while read fname lname uid pass... (0 Replies)
Discussion started by: sh_ksa
0 Replies

4. Shell Programming and Scripting

To Read a File and Insert a part of the lines into the database

Hi Guys I need to have a shell script which reads a log file and insert a part of each line into the database. Some sample lines in the file are as below. 20091112091359 MED_RQACK : user_data=60173054304,100232120,20091112091359,;ask_status=0;ask_reason=OK;msg_id=20091112091319... (5 Replies)
Discussion started by: Somanadh
5 Replies

5. Shell Programming and Scripting

Read file and for each line replace two variables, add strings and save output in another file

Hi All, I have a file, let's call it "info.tmp" that contains data like this .. ABC123456 PCX333445 BCD789833 I need to read "info.tmp" and for each line add strings in a way that the final output is put /logs/ua/dummy.trigger 'AAA00001.FTP.XXX.BLA03A01.xxxxxx(+1)' where XXX... (5 Replies)
Discussion started by: Andy_ARG
5 Replies

6. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

7. Programming

Read file and add value

i have a file outfile.txt which contain 12 22 i have written this program to read the file and show the output,but i dont know how to add these value and show the total. my-codes are #include<cmath> #include<cstdlib> #include<iostream> #include<fstream> using namespace std; int main ()... (4 Replies)
Discussion started by: console
4 Replies

8. Shell Programming and Scripting

Read a file, add some text and send an email

Hi, If I am asking this question, you must have already figured out , that I am new to Unix, so here it goes I was trying to read a file, add some user defined content to it and send out an email , I did find out a way to achieve this, but looking at the code, it looks a bit crude to me, can... (3 Replies)
Discussion started by: karthikbhuvana
3 Replies

9. Shell Programming and Scripting

How to print the specific part of the file name with file creation date?

Hello Folks, I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern. Filename: MobileProtocol.20171228T154200.157115.udr I want to get the count of files created on each day based on a pattern find. find . -type... (7 Replies)
Discussion started by: sadique.manzar
7 Replies

10. UNIX for Beginners Questions & Answers

How to make a loop to read the input from a file part by part?

Hi All, We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)
Discussion started by: arun_adm
6 Replies
DwtMainSetAreas(3Dwt)													     DwtMainSetAreas(3Dwt)

Name
       DwtMainSetAreas - Sets up or adds the menu bar, command window, work window, and scroll bar widgets to the main window widget of the appli-
       cation.

Syntax
       void DwtMainSetAreas(widget, menu_bar, work_window,
			    command_window, horizontal_scroll_bar,
			    vertical_scroll_bar)
	    Widget widget;
	    Widget menu_bar;
	    Widget work_window, command_window;
	    Widget horizontal_scroll_bar, vertical_scroll_bar;

Arguments
       widget	 Specifies the main window widget ID.

       menu_bar  Specifies the widget ID for the menu bar to be associated with the main window widget.  You can set this ID only  after  creating
		 an instance of the main window widget.  The attribute name associated with this argument is DwtNmenuBar.

       work_window
		 Specifies  the widget ID for the work window to be associated with the main window widget.  You can set this ID only after creat-
		 ing an instance of the main window widget.  The attribute name associated with this argument is DwtNworkWindow.

       command_window
		 Specifies the widget ID for the command window to be associated with the main window widget.  You can set this ID only after cre-
		 ating an instance of the main window widget.  The attribute name associated with this argument is DwtNcommandWindow.

       horizontal_scroll_bar
		 Specifies  the scroll bar widget ID for the horizontal scroll bar to be associated with the main window widget.  You can set this
		 ID only after creating an instance of the main window widget.	The attribute name associated with this argument  is  DwtNhorizon-
		 talScrollBar.

       vertical_scroll_bar
		 Specifies the scroll bar widget ID for the vertical scroll bar to be associated with the main window widget.  You can set this ID
		 only after creating an instance of the main window widget.  The attribute  name  associated  with  this  argument  is	DwtNverti-
		 calScrollBar.

Description
       The  DwtMainSetAreas  function  sets up or adds the menu bar, work window, command window, and scroll bar widgets to the application's main
       window widget.  You must set these areas up before the main window widget is realized, that is, before calling the  X  intrinsics  function
       XtRealizeWidget.

       Each area is optional; therefore, you can pass NULL to one or more of these arguments.  The title bar is provided by the window manager.

See Also
       Guide to the XUI Toolkit: C Language Binding
       Guide to the XUI Toolkit Intrinsics: C Language Binding

															     DwtMainSetAreas(3Dwt)
All times are GMT -4. The time now is 05:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy