06-06-2016
ksh : split hex number group
Hi,
sry for poor english
I have a group of hex number as : 4D40:4D42
I want so split this group in a list as :
4D40,4D41,4D42
i don't know how i can do this in ksh
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
typeset -i A=16#0
typeset -u A=$a
y=${A#16#}
This converted $a to hex and stored it in y.
Can someone walk me through how this was done?
thanks (2 Replies)
Discussion started by: JamesByars
2 Replies
2. UNIX for Advanced & Expert Users
hi,
which Unix/C function can i use to retrieve all group names with a particular group id?
The following C code prints out the group id number of a particular group name:
------------------------------------------------------------------------
#include <stdio.h>
#include <grp.h>
int... (3 Replies)
Discussion started by: Andrewkl
3 Replies
3. Shell Programming and Scripting
Hi I want to incremental add hex decimal number to a particula field in file
eg: addr =123 dept1=0
addr = 345 dept2 =1
addr2 = 124 dept3 =2
.
.
.
.
.
.
addr3 =567 dept15 =f
Is there any command which add... (8 Replies)
Discussion started by: diddi_linux
8 Replies
4. Shell Programming and Scripting
Guys
Following input line is from /etc/group file.As we know last entry in a line of /etc/group is userlist (all the users belonging to that group).
I need to splilt this one line into 3 lines as shown below (3 because userlist has 3 names in it).
Input:
lp:!:11:root,lp,printq
... (13 Replies)
Discussion started by: ak835
13 Replies
5. Shell Programming and Scripting
Guys, I am looking for a small script which generates HEX sequence. Input to the script is starting hex number - Group ID and number of members in a group and total groups.
e.g: we are generating 2 groups with 4 Members each starting with hex number 036A. I should get o/p in following format.
... (5 Replies)
Discussion started by: dynamax
5 Replies
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
$ awk 'BEGIN{ pat111=0x1000000002E3E02; snBegin=0x1000000002E3E01; if (pat111<=snBegin) printf "a\n"}'
a
Result is not correct.
Looks like the number is too big.
Any idea?
Thx!
Please use code tags <- click the link! (2 Replies)
Discussion started by: carloszhang
2 Replies
8. Shell Programming and Scripting
Hello,
I woild like to convert hex on KSH not BASH:
I tried to use:
tmp=31
printf "\x"${tmp}""
it works on bash - Output is '1' but not on ksh.
please advice on the right syntax.
Thanks. (4 Replies)
Discussion started by: LiorAmitai
4 Replies
9. Shell Programming and Scripting
Need some help doing this ... with awk maybe
Input
0DF6
0DF7
0DF8
0DF9
0DFA
0DFB
0DFC
0DFD
0DFF
0E00
0E01
0E02
0E03
0E04
0E05
0E06 (11 Replies)
Discussion started by: greycells
11 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I'm looking to split the following hex string into rows of four elements.
I've tried the following but it doesn't seem to work. How can I tell sed to match based on a pair of number(s) and letter(s), and add a newline every 4 pairs?
In addition, I need to add another newline after every... (5 Replies)
Discussion started by: sand1234
5 Replies
LEARN ABOUT REDHAT
initgroups
INITGROUPS(3) Linux Programmer's Manual INITGROUPS(3)
NAME
initgroups - initialize the supplementary group access list
SYNOPSIS
#include <grp.h>
#include <sys/types.h>
int initgroups(const char *user, gid_t group);
DESCRIPTION
The initgroups() function initializes the group access list by reading the group database /etc/group and using all groups of which user is
a member. The additional group group is also added to the list.
RETURN VALUE
The initgroups() function returns 0 on success, or -1 if an error occurs.
ERRORS
EPERM The calling process does not have sufficient privileges.
ENOMEM Insufficient memory to allocate group information structure.
FILES
/etc/group group database file
CONFORMING TO
SVID 3, BSD 4.3
NOTES
The prototype for initgroups is only available if _BSD_SOURCE is defined (either explicitly, or implicitly, by not defining _POSIX_SOURCE
or compiling with the -ansi flag).
SEE ALSO
getgroups(2), setgroups(2)
GNU
1993-04-05 INITGROUPS(3)