Sponsored Content
Top Forums Shell Programming and Scripting Add leading zero's to the number in unix Post 302374657 by Scrutinizer on Wednesday 25th of November 2009 07:06:14 AM
Old 11-25-2009
Well, if one always wants exactly 5 0's, this could also be used:
Code:
echo "00000$x, 00000$y"

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FTP Between UNIX & Windows drops leading blanks

I am using ftp on Solaris to transfer files to Windows 2000 that have leading blanks in the name (ex. " 12345A4444.BIN"). When they get to Windows the leading blanks are stripped off. Has anyone encountered this and is there a fix? If I use Hummingbird it is ok but that is not an option for... (6 Replies)
Discussion started by: worf52
6 Replies

2. Shell Programming and Scripting

Add leading zeroes to numbers in a file

Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Discussion started by: raidzero
3 Replies

3. UNIX for Dummies Questions & Answers

Add leading zero

Hi there, I'm trying to add to a number leading zeros if it's just one digit. My code looks like this: d=`date +%d` if ; then d=$((d-1)) # yesterday if (length($d) -eq 1); then d=0$d # this doesn't work if it's the 1st of the month :-( fi ... $d... (4 Replies)
Discussion started by: borobudur
4 Replies

4. UNIX for Dummies Questions & Answers

Triml leading zeros in unix

Hi All, How does one trim leading zero's in unix Thanks KP. (7 Replies)
Discussion started by: kingofprussia
7 Replies

5. Shell Programming and Scripting

excel drops leading zeros while attaching through unix

HEllo All, when the data file is being attached and mailed as file1.csv, the column data( e.g: 88E00, 99E00, 77F12, 66H18). The data 88E00 and 99E00 is being converted to 88E+01, 99E+01. All other data is fine. I need the file attached as .csv from unix only. Is there a way we can manage... (2 Replies)
Discussion started by: OSD
2 Replies

6. Shell Programming and Scripting

Add leading zeros in floating point variable

I need to add leading zeros in a floating point numbers. The length of the number should be 13 including decimal. The input number is changing so number of leading zeros is not fix. For example input output 216.000 000000216.000 1345.000 000001345.000 22345.500 ... (4 Replies)
Discussion started by: reeta_shri
4 Replies

7. Shell Programming and Scripting

awk to remove leading zeros for a hex number

Is it possible by using awk to remove leading zeros for a hex number? ex: 0000000011179E0A -> 11179E0A Thank you! (4 Replies)
Discussion started by: carloszhang
4 Replies

8. UNIX for Dummies Questions & Answers

Add leading zeros to columns in a file

Hello Gurus, Quick question. I have a file with the following records: A~000000000000518000~SLP ~99991231~20090701~88.50~USD~CS~ A~000000000000518000~SLP ~99991231~20090701~102.00~USD~CS~ A~000000000000772000~SLP ~99991231~20100701~118.08~USD~CS~ I wold like to do the following: 1. Add... (1 Reply)
Discussion started by: chumsky
1 Replies

9. Shell Programming and Scripting

How to add line number using UNIX command?

Hi, I am working on Shell script and I have a .dat file in which I want to add line numbers. Please see below example file Input File: 19523479811841494432C2013052700000000 19523479811730333980A2013052700000000 19523479811417044397I2013052700000000 19523479811205895810A2013052700000000... (7 Replies)
Discussion started by: jnrohit2k
7 Replies

10. Shell Programming and Scripting

Ho to remove leading zeros from a csv file which is sent from a UNIX script

Hi All, I am using a informatica job to create a csv file and a unix script the mail the generated file.Everything is working fine but I am not seeing leading zeros in the csv file sent in the mail.These zeros were present when the .csv file was generated by informatica procees. Is there any... (11 Replies)
Discussion started by: karthik adiga
11 Replies
TERM(7) 						 Miscellaneous Information Manual						   TERM(7)

NAME
terminals- conventional names DESCRIPTION
These names are used by certain commands and are maintained as part of the shell environment (see sh(1),environ(5)). 1620 DIABLO 1620 (and others using HyType II) 1620-12 same, in 12-pitch mode 300 DASI/DTC/GSI 300 (and others using HyType I) 300-12 same, in 12-pitch mode 300s DASI/DTC 300/S 300s-12 same, in 12-pitch mode 33 TELETYPE(R) Model 33 37 TELETYPE Model 37 40-2 TELETYPE Model 40/2 43 TELETYPE Model 43 450 DASI 450 (same as Diablo 1620) 450-12 same, in 12-pitch mode 450-12-8 same, in 12-pitch, 8 lines/inch mode 735 Texas Instruments TI735 (and TI725) 745 Texas Instruments TI745 dumb terminals with no special features hp Hewlett-Packard HP264? series terminals 4014 Tektronix 4014 tn1200 General Electric TermiNet 1200 tn300 General Electric TermiNet 300 vt05 Digital Equipment Corp. VT05 Commands whose behavior may depend on the terminal accept arguments of the form -Tterm, where term is one of the names given above. If no such argument is present, a command may consult the shell environment for the terminal type. SEE ALSO
stty(1), tabs(1), plot(1), sh(1), environ(5) troff(1) for nroff BUGS
The programs that ought to adhere to this nomenclature do so only fitfully. TERM(7)
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy