01-03-2020
Try print instead of printf. The latter treats the first argument as a format string where % characters are special.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Does Anybody know how to print procedures written in this format?
..
.nr PS 11
.nr VS 14
.nr LL 6.5i
.ad l
.DA 1/9/91
.in 4.0i
.DS
Shepard D. Johnson
.DE
.in 0i
.sp
.sp
.sp
.LG
.ce
.B
Pressure Sensors (P/N 16-0018-0 & 16-0018-1) Test Procedure (1 Reply)
Discussion started by: rjtrjt
1 Replies
2. Shell Programming and Scripting
Hello Experts,,
I m facing a problem as follows.. need help..
When I am giving the below command it gives me three digit hexadecimal number , for ex :-
printf("%0.3x", 10);
Output: 00a
But I want the same for signed number also.
Now when I am specifiying the... (10 Replies)
Discussion started by: user_prady
10 Replies
3. Shell Programming and Scripting
Hi All ,
Below is the perl code. from below code want to confirm one thing that
wahtever the sequence of data we are passing through json format which contains 3 tuples of different sequences
Eg:
ParentID,SystemID,SendingTime,Time,ClientLocation,ClientID,
... (1 Reply)
Discussion started by: aish11
1 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
I have a input file say record.txt
hostname IP_address Port_No Version
A 10.10.10.1 80 6.02
B 10.10.10.2 81 6.03
C 10.10.10.3 82 6.04
row 1 has 4 field headings : hostname, IP_address, Port_No and Version.
and from 2nd row onwards the actual records start.
now i need to... (2 Replies)
Discussion started by: PranavEcstasy
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I need help in printing data in below format from file extensions with .dml, i have listed details below
file name is test_temp.dml, location in /home/users/test01/test_temp.dml
file content:
sample_type=
record
decimal(",") test_type;
date("DD-MM-YYYY")(",") test_date... (2 Replies)
Discussion started by: AAHinka
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
below 'awk' code was given for my thread 'Help with printing output format from a file ' earlier, however script is not resulting expected output with below file content.
cat test_tes123.dml
record
string("\001") emp_num; /* CHAR(11) NOT NULL*/
date("YYYYMMDD")... (1 Reply)
Discussion started by: AAHinka
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have following files in a directory with '.meta' extension, which have data in follwoing patterns. i need to print data from these files in below metioned format. please provide a script for this solution.
file names:
TEST_HISTORY_MTH.meta
AB_TEST_1.meta
cat... (2 Replies)
Discussion started by: AAHinka
2 Replies
8. Shell Programming and Scripting
Hi All,
I 'm matching two files based on the first 2 columns and then populate other fields along with subtraction of few fields.
I have managed to get the output. However, is there a easier way in formatting the output as shown below instead of using additional printf for getting fixed width... (4 Replies)
Discussion started by: shash
4 Replies
9. Shell Programming and Scripting
Dear friends,
I'm getting below API result and i would like to format them with Shell scripting.
Input
"id": 9,
"description": "short desc",
"name": "test",
"name_with_namespace": "ABCD-PDFF-PLATFORM-TEST-V1 / test",
"path": "test",
"path_with_namespace":... (7 Replies)
Discussion started by: baluchen
7 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I am new to shell scripting, Need your help in creating a shell script which converts any unix command output to JSON format output.
example:
sample df -h command ouput :
Filesystem size used avail capacity Mounted
/dev/dsk/c1t0d0s0 8.1G 4.0G 4.0G 50% /... (13 Replies)
Discussion started by: balu1234
13 Replies
DP(8) [nmh-1.5] DP(8)
NAME
dp - parse dates 822-style
SYNOPSIS
/usr/lib/mh/dp [-form formatfile] [-format string] [-width columns] [-version] [-help] dates ...
DESCRIPTION
Dp is a program that parses dates according to the ARPA Internet standard. It also understands many non-standard formats, such as those
produced by TOPS-20 sites and some UNIX sites using ctime(3). It is useful for seeing how nmh will interpret a date.
The dp program treats each argument as a single date, and prints the date out in the official 822-format. Hence, it is usually best to
enclose each argument in quotes for the shell.
To override the output format used by dp, the -format string or -format file switches are used. This permits individual fields of the
address to be extracted with ease. The string is simply a format string and the file is simply a format file. See mh-format(5) for the
details.
Here is the default format string used by dp:
%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>
which says that if an error was detected, print the error, a `:', and the date in error. Otherwise, output the 822-proper format of the
date.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
None
SEE ALSO
ap(8), Standard for the Format of ARPA Internet Text Messages (RFC-822)
DEFAULTS
`-format' default as described above
`-width' default to the width of the terminal
CONTEXT
None
BUGS
The argument to the -format switch must be interpreted as a single token by the shell that invokes dp. Therefore, one must usually place
the argument to this switch inside quotes.
MH.6.8 11 June 2012 DP(8)