Sponsored Content
Top Forums Shell Programming and Scripting printing the content from a file Post 302330168 by jim mcnamara on Tuesday 30th of June 2009 11:10:53 AM
Old 06-30-2009
awk:
Code:
echo 'instance name WSL port JSL port JRAD port'; echo ""
awk '/^THE/ {printf("%s\t", $4); next}
     /=/ { gsub( /.*=/, "", $0); printf("%s\t", $0); next}
     /^$/ {printf("\n")}
    ' filename

output:
Code:
/home/jmcnama> t.awk
instance name WSL port JSL port JRAD port

VPORCL01        1533    9000    9100

VPORCL02        7000    9000    9100

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with awk - how to read a content of a file from every file from file list

Hi Experts. I need to list the file and the filename comes from the file ListOfFile.txt. Basicly I have a filename "ListOfFile.txt" and it contain Example of ListOfFile.txt /home/Dave/Program/Tran1.P /home/Dave/Program/Tran2.P /home/Dave/Program/Tran3.P /home/Dave/Program/Tran4.P... (7 Replies)
Discussion started by: tanit
7 Replies

2. Shell Programming and Scripting

Printing out desired content

I want this script to read notes and print the contents of any file that starts with messages and is possibly followed by a period and a digit. I've made this code, but how do I make it so that IF there is a period and a digit. Right now it only prints out the result if it is for example;... (8 Replies)
Discussion started by: HardyV2
8 Replies

3. Windows & DOS: Issues & Discussions

Linux to Windows Printing: PDF starts printing from middle of page.

We are using Red Hat. We have a issue like this: We want to print from Linux, to a printer attached to a Windows machine. What we want to print is a PDF. It prints, but the printing starts from the middle of the page. In the report, there is no space at the top but still printing starts from the... (5 Replies)
Discussion started by: rohan69
5 Replies

4. UNIX for Dummies Questions & Answers

Sco Unix printing : jobs hangs in queue - printing via lp versus hpnpf

Hi, We have a Unix 3.2v5.0.5. I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts). This is the configuration file : Code: root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies

5. Shell Programming and Scripting

Sed: replace content from file with the content from file

Hi, I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C. Thanks a lot!! Here is a sample of my question. e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Discussion started by: dirkaulo
3 Replies

6. Shell Programming and Scripting

Facing issues with Content-Type:application/x-download Content-Disposition:attachment

I am in the process of developing a perl cgi page. I had succeeded in developing the page but there are few errors/issues with the page. description about cgi page: My CGI page retrieves all the file names from an directory and displays the files in drop down menu for downloading the... (5 Replies)
Discussion started by: scriptscript
5 Replies

7. Shell Programming and Scripting

Change the file name and copy old file content to new file names.

Hi, I have a files in a directory as below :- ls -1 mqdepth-S1STC02 proc-mq-S1STC01 proc-mq-S1STC02 proc-mq-S1STC03 Whereever i have S1STC i need to copy them into new file with file name S2STC. expected output :- ls -1 mqdepth-S2STC02 proc-mq-S2STC01 proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies

8. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

9. Shell Programming and Scripting

Insert content of a file to another file at a line number which is given by third file

Hi friends, here is my problem. I have three files like this.. cat file1.txt ======= unix is best unix is best linux is best unix is best linux is best linux is best unix is best unix is best cat file2.txt ======== Windows performs better Mac OS performs better Windows... (4 Replies)
Discussion started by: Jagadeesh Kumar
4 Replies
Jifty::CAS(3pm) 					User Contributed Perl Documentation					   Jifty::CAS(3pm)

NAME
Jifty::CAS - Jifty's Content-Addressable Storage facility SYNOPSIS
my $key = Jifty::CAS->publish('js' => 'all', $content, { hash_with => $content, # default behaviour content_type => 'application/x-javascript', }); $ie_key = Jifty::CAS->publish('js' => 'ie-only', $ie_content, { hash_with => $ie_content, content_type => 'application/x-javascript', }); $key = Jifty::CAS->key('js', 'ie-only'); my $blob = Jifty::CAS->retrieve('js', $key); DESCRIPTION
Provides an in-memory "md5"-addressed content store. Content is stored under a "domain", and can be addressed using wither the "key", which is an "md5" sum, or the "name", which simply stores the most recent key provided with that name. BACKENDS
The default data store is an per-process, in-memory store. A memcached backed store is also available and has the benefits of sharing the cache across all instances of a Jifty app using Jifty::CAS. The memcached store is limited to objects less than 1MB in size, however. METHODS
publish DOMAIN NAME CONTENT METADATA Publishes the given "CONTENT" at the address "DOMAIN" and "NAME". "METADATA" is an arbitrary hash; see Jifty::CAS::Blob for more. Returns the key on success, or undef on failure. key DOMAIN NAME Returns the most recent key for the given pair of "DOMAIN" and "NAME", or undef if none such exists. retrieve DOMAIN KEY Returns a Jifty::CAS::Blob for the given pair of "DOMAIN" and "KEY", or undef if none such exists. serve_by_name DOMAIN NAME REQUESTED_KEY Intelligently serves up the content of the object at NAME (not REQUESTED_KEY) in DOMAIN. REQUESTED_KEY is currently used only to check if the content at NAME equals the content requested. If so, this method responds with an HTTP 304 status, indicating the content hasn't changed. This use case assumes that content is served to clients from the CAS with the CAS key (an MD5 sum) as the filename or part of it. The "content_type" key in the requested object's metadata is expected to be set and is used for the HTTP response. This method is usually called from a dispatcher rule. Returns the HTTP status code set by this method (possibly for your use in the dispatcher). perl v5.14.2 2010-09-25 Jifty::CAS(3pm)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy