Sponsored Content
Full Discussion: Pad Zeros at the end
Top Forums Shell Programming and Scripting Pad Zeros at the end Post 302581398 by jayan_jay on Tuesday 13th of December 2011 06:00:03 AM
Old 12-13-2011
go with this ..
Code:
$ z=10
$ echo "1234 * 10^$z" | bc
12340000000000

 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

pad Zeros

Hi can I know command to pad Zeros to a value I get 16 and I need to send 0000000016 (5 Replies)
Discussion started by: mgirinath
5 Replies

2. Shell Programming and Scripting

Pad zeros to a number

Pad zeros to a number and assign it to a variable like i get 1 in $i ,i want it to be $i as 01 (6 Replies)
Discussion started by: anumkoshy
6 Replies

3. Programming

How to right pad with zeros using sprintf?

I need to right-pad with zeros a string by using (s)printf. I looked up the manual and tried with printf("%-19s", buffer); which right-pad the string with spaces. So I tried printf("%019s", buffer); which left-pad the string with zeros. So I tried both printf("%-019s", buffer);... (9 Replies)
Discussion started by: emitrax
9 Replies

4. Shell Programming and Scripting

Reformat a string and pad space at the end

I need to read in the string from input file and reform it by cut each segment and check the last segement lenght. If the last segment length is not as expected (see below segment file or table. It is predefined), then pad enough space. Old string FU22222222CA6666666666AKxvbFMddreeadBP999... (1 Reply)
Discussion started by: menglm
1 Replies

5. Shell Programming and Scripting

Pad space at the end of string and reformat

I need to read in the string from input file and reform it by cut each segment and check the last segement lenght. If the last segment length is not as expected (see below segment file or table. It is predefined), then pad enough space. Old string FU22222222CA6666666666AKxvbFMddreeadBP999... (11 Replies)
Discussion started by: menglm
11 Replies

6. Shell Programming and Scripting

How to pad with leading zeros for current time?

I'm using cygwin bash to submit scheduled tasks (kinda like cron jobs) in windows and the following script is giving me grief. I need to format the current time with leading zeros before 10AM for the hour field. In this example, I manually typed in "09:50" instead of using the `printf...`... (2 Replies)
Discussion started by: siegfried
2 Replies

7. UNIX for Beginners Questions & Answers

Pad 0 to the right

I need to pad 0 to a number on the right. to make it 9 digit in total. My number is 2457 output should be 245700000 Please do wrap your samples/codes into CODE TAGS as per forum rules. (3 Replies)
Discussion started by: varun22486
3 Replies
Cgroup classifier in tc(8)					       Linux						Cgroup classifier in tc(8)

NAME
cgroup - control group based traffic control filter SYNOPSIS
tc filter ... cgroup [ match EMATCH_TREE ] [ action ACTION_SPEC ] DESCRIPTION
This filter serves as a hint to tc that the assigned class ID of the net_cls control group the process the packet originates from belongs to should be used for classification. Obviously, it is useful for locally generated packets only. OPTIONS
action ACTION_SPEC Apply an action from the generic actions framework on matching packets. match EMATCH_TREE Match packets using the extended match infrastructure. See tc-ematch(8) for a detailed description of the allowed syntax in EMATCH_TREE. EXAMPLES
In order to use this filter, a net_cls control group has to be created first and class as well as process ID(s) assigned to it. The follow- ing creates a net_cls cgroup named "foobar": modprobe cls_cgroup mkdir /sys/fs/cgroup/net_cls mount -t cgroup -onet_cls net_cls /sys/fs/cgroup/net_cls mkdir /sys/fs/cgroup/net_cls/foobar To assign a class ID to the created cgroup, a file named net_cls.classid has to be created which contains the class ID to be assigned as a hexadecimal, 64bit wide number. The upper 32bits are reserved for the major handle, the remaining hold the minor. So a class ID of e.g. ff:be has to be written like so: 0xff00be (leading zeroes may be omitted). To continue the above example, the following assigns class ID 1:2 to foobar cgroup: echo 0x10002 > /sys/fs/cgroup/net_cls/foobar/net_cls.classid Finally some PIDs can be assigned to the given cgroup: echo 1234 > /sys/fs/cgroup/net_cls/foobar/tasks echo 5678 > /sys/fs/cgroup/net_cls/foobar/tasks Now by simply attaching a cgroup filter to a qdisc makes packets from PIDs 1234 and 5678 be pushed into class 1:2. SEE ALSO
tc(8), tc-ematch(8), the file Documentation/cgroups/net_cls.txt of the Linux kernel tree iproute2 21 Oct 2015 Cgroup classifier in tc(8)
All times are GMT -4. The time now is 12:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy