Sponsored Content
Full Discussion: format string output
Top Forums Shell Programming and Scripting format string output Post 302471265 by methyl on Friday 12th of November 2010 11:23:12 AM
Old 11-12-2010
This is not possible. The line breaks and multiple spaces in the "ps" output will be lost.
What do you want to do with $message ? There will no doubt be another way without putting the output from "ps" into an environment variable.

Please also mention what Operating System and version you have and which Shell you are using.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ls output format

below is the output is ls -l -rw-r--r-- 1 tonyt staff 3212 Apr 17 1999 file1 -rw-r--r-- 1 tonyt staff 4541 Mar 3 21:08 file2 why the date format is not the same? (6 Replies)
Discussion started by: tonyt
6 Replies

2. Shell Programming and Scripting

capturing output from top and format output

Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date `top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03 Cpu(s): 3.4% us, 8.5% sy .. .. Mem: 1011480k total, 226928k used, ....... (4 Replies)
Discussion started by: new2ss
4 Replies

3. Shell Programming and Scripting

How to format output

Dear all, I have written a program which access database and displays the values returned by the query . There are 10 columns to be displayed in one row. But am ending with 5 lines displayed on 1st line and the next 5 in the 2nd line. Ex : 21608 10-20-2007 148 Al's Appliance... (7 Replies)
Discussion started by: uday542
7 Replies

4. UNIX for Advanced & Expert Users

Format the Output

Hi- Objective of the task is to print the lines which doesnt have a END statement corresponding to a START statement. Let me know if anyone has a better way of doing is. My Thoughts Have 2 files one having START lines and another having END lines (sorted). And then diff the files to get... (8 Replies)
Discussion started by: lorcan
8 Replies

5. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

6. Shell Programming and Scripting

awk: round output or delimit output of arithmatic string

I have a file with the following content. > cat /tmp/internetusage.txt 6709.296322 30000 2/7/2010 0.00I am using the following awk command to calculate a percentage from field 1 and 2 from the file. awk '{ print $1/$2*100 }' /tmp/internetusage.txt This outputs the value "22.3643" as a... (1 Reply)
Discussion started by: jelloir
1 Replies

7. Shell Programming and Scripting

Output for 'who' in particular format

echo `whoami;echo @;who -ms | cut -f 2 -d "(" | sed "s/)$//"` getting output as : <userid> @ <machinename> Is it possible to get output as : <userid>@<machinename> (9 Replies)
Discussion started by: lalitpct
9 Replies

8. Shell Programming and Scripting

FORMAT output

Input File Symmetrix ID : 000192601507 Masking View Name : TS00P22_13E_1 Last updated at : 05:10:18 AM on Tue Mar 22,2011 Initiator Group Name : 10000000c960b9cd Host Initiators { WWN : 10000000c960b9cd WWN : 10000000c960b9dd } Port... (1 Reply)
Discussion started by: greycells
1 Replies

9. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

10. Shell Programming and Scripting

Format with output

I have written some scripts that resulted in the table below (Column1 is ITEM, Column2 is Group, Column3 is Category and Column4 is Quantity) but I want the output in another format: Input: K123 X CATA 3 K123 Y CATA 4 K123 Z CATA 2 K123 X CATB 5 K123 Y CATB 2 K123 Z CATB 2 B65 M CATB... (7 Replies)
Discussion started by: aydj
7 Replies
ap(8mh) 																   ap(8mh)

Name
       ap - parse addresses RFC 822-style

Syntax
       /usr/lib/mh/ap [ -form file ] [ -format string ] [ -help ] [ -[no]normalize ] [ -width columns ] addrs ...

Description
       The  program  parses  addresses	according to the ARPA Internet standard.  It also understands many non-standard formats.  It is useful for
       seeing how MH will interpret an address.

       The program treats each argument as one or more addresses, and prints those addresses in the official RFC 822 format.  Hence, it is usually
       best to enclose each argument in double quotes (") for the shell.

       In  addition  to  the  standard	escapes,  also recognizes the additional escape error, which is a diagnostic that is returned if the parse
       failed.

Options
       -form file
		 Overrides the default output format of The output is formatted according to the instructions in the specified file.  This must be
		 a format file; see

       -format string
		 Overrides  the default output format of The output is formatted according to the instructions in the specified string.  This must
		 be a format string; see

		 The argument to the -format option must be interpreted as a single token by the shell that invokes Therefore, you should  usually
		 place the argument to this option inside double quotes (").

       -help	 Prints a list of the valid options to this command.

       -normalize
       -nonormalize
		 Tells	to  try  to  find  the	official  host name of the address.  This is the default behavior.  It can be suppressed using the
		 -nonormalize option.

       -width columns
		 Specifies the width of the screen in columns.

       The defaults for this command are as follows:

	      -normalize
	      -width defaults to the width of the terminal

Restrictions
       On systems where MH is configured with the BERK option, address parsing is not enabled.

Examples
       This is the default format string used by
       %<{error}%{error}: %{text}%|%(proper{text})%>
       If an error was detected, this string instructs to print the error, a colon (:), and the address that is in error.  Otherwise,  output  the
       proper RFC 822 format of the address.

Files
       User profile.

       System customization file.

See Also
       mh-format(5mh), dp(8mh)
       Standard for the Format of ARPA Internet Text Messages (RFC 822)

																	   ap(8mh)
All times are GMT -4. The time now is 05:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy