The X ends the specifier and denotes that it should be interpreted as a number and displayed as hexidecimal.The 2 says that the specifier should be displayed taking up two characters worth of width.A leading zero (0) in a format specifier means that the resulting numeric output should be padded with leading zeros up to the specified width.% in the format string introduces a "format specifier" which can be one or more characters telling how to format the arguments.The printf program is based on the C "printf" function, which takes a "format string" as the first parameter and then additional parameters fill in the format string.Probably a better solution would be to use printf: printf '00-60-2F-X-X-X\n' $ $ $ In the past I've done this using: echo 00-60-2F-$$-$$-$$īut that will only make them in the range 0-9.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |