Sponsored Content
Full Discussion: printf format
Top Forums Shell Programming and Scripting printf format Post 53501 by zazzybob on Friday 16th of July 2004 11:54:19 AM
Old 07-16-2004
You can escape the % by using %% instead (to print a literal %).

Change your code to
Code:
HDR=`ps -e -o user,pid,ppid,pcpu,stime,etime,time,comm | head -n 1 | sed 's/%/%%/g'`
printf "%s" HDR

This code is for bash/ksh

Cheers
ZB
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk printf formatting using string format specifier.

Hi all, My simple AWK code does C = A - B If C can be a negative number, how awk printf formating handles it using string format specifier. Thanks in advance Kanu :confused: (9 Replies)
Discussion started by: kanu_pathak
9 Replies

2. Shell Programming and Scripting

How to format the output using float in awk{printf}

Hi I'm using awk to manipulate the data in the 6th field of the file xxx_yyy.hrv. The sample data that is available in this field is given below 220731.7100000000000000 When i tried using this command cat xxx_yyy.hrv | awk '{printf("%23.16f\n",$6*-1)}' I get the output as... (4 Replies)
Discussion started by: angelarosh
4 Replies

3. Shell Programming and Scripting

printf to format lines.

Hey, I'm trying to read printf(3) and seems I need to use the * WIDTH but I'm not quite sure how to go about it. there needs to be 3 fields per line, the lines read in from file looks like this: JUICE - APPLE:JUST JUICE:7 MILK - CHOCOLATE:BREAKA:7 this needs to be output backwards with... (6 Replies)
Discussion started by: gcampton
6 Replies

4. Shell Programming and Scripting

Assigning a specific format to a specific column in a text file using awk and printf

Hi, I have the following text file: 8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm 9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm 10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm 11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies

5. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

6. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

7. UNIX for Dummies Questions & Answers

awk printf in required format

Hi my awk variable $0 contains the below data Input file 000001 The Data 000002* The line 2 000003* The line3 output file Req 000001* The Data 000002** The line 2 000003** The line3 one * at column seven needs to be appended to the input lines, (5 Replies)
Discussion started by: rakeshkumar
5 Replies

8. Shell Programming and Scripting

awk printf format in columns

Hi all, i have written this script: awk -F';' ' BEGIN { printf "\n" printf "\n" printf "\n" printf "----------------------------------------------\n" print " For test " printf "----------------------------------------------\n" test_200 = 0 test_300 = 0 test_500 = 0 test_1000 = 0... (11 Replies)
Discussion started by: arrals_vl
11 Replies

9. Shell Programming and Scripting

printf format with awk

Hello Here is an easy one Data file 12345 (tab) Some text (tab) 53.432 23456 (tab) Some longer text (tab) 933.422 34567 (tab) Some different text (tab) 29.309 I need to awk these three tab-delimited columns so that the first two are unchanged (unformatted) and the third shows two decimal... (1 Reply)
Discussion started by: palex
1 Replies

10. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies
pfsinpfm(1)						      General Commands Manual						       pfsinpfm(1)

NAME
pfsinpfm - Load images or frames in PFM format SYNOPSIS
pfsinpfm (<file> [--frames <range>] [--skip-missing]) [<file>...] DESCRIPTION
Use this command to read frames in PFM format. PFM format is used for HDR Shop plug-ins and is also supported by some recent versions of NetPBM package (pamtopfm and pfmtopam commands). The frames are converted to pfs stream and send to the Standard Output. This command can handle both color and gray-scale images. Details on the format of the pattern file names, which are used for reading multiple frames, can be found in the manual page of pfsinppm. To automatically recognize a file format from the extension, use pfsin command instead. EXAMPLES
pfsin memorial.pfm | pfsout memorial.hdr Converts from one HDR format to another BUGS
pfsinpfm does not handle images that store floating point numbers using big-endian format. pfsoutpfm may also read floating point numbers incorrectly on big-endian machines. Please report bugs and comments on implementation to the discussion group http://groups.google.com/group/pfstools SEE ALSO
pfsin(1) pfsinppm(1) pfsoutpfm(1) pfsinpfm(1)
All times are GMT -4. The time now is 10:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy