12-12-2009
I don't have enough information on what the file looks like and what needs to be done. Can you make a better example of what the real file looks like and how it needs to be processed?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All, This work could be very easy for you guys. I would really appreciate help.
input file:
output file: (Desired)
What I am capable of doing:
Command: cat inputfile | awk -F\| '{print "num="$1" value="$2" digits="$3" name1="$4" file="$5" code="$6}' > outputfile
Result what I am... (5 Replies)
Discussion started by: onlyroshni
5 Replies
2. UNIX for Advanced & Expert Users
Hey all,
Can I put sed command inside the awk action ?? If not then can i do grep in the awk action ??
For ex:
awk '$1=="174" { ppid=($2) ; sed -n '/$ppid/p' tempfind.txt ; }' tempfind.txt
Assume: 174 is string.
Assume: tempfind.txt is used for awk and sed both.
tempfind.txt... (11 Replies)
Discussion started by: varungupta
11 Replies
3. Shell Programming and Scripting
I want to write a shell script which traverses a cpp file.
Suppose there is function fncn_name6 .. which is called by fncn_name5
which in turn called by fncn_name4 and so on .. in a single cpp class.
ie
fncn_name1
{
fncn_name2
{
fncn_name3
}
{
fncn_name4
... (0 Replies)
Discussion started by: ultimatix
0 Replies
4. Shell Programming and Scripting
please let me know if the below code could be written efficiently inside single awk
case "$INP" in
ksh)
cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}'
;;
pset)
cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}'
;;
dml)
cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
Discussion started by: cvsanthosh
2 Replies
5. Shell Programming and Scripting
I am trying to search the pattern "ARS (11)" and after the LAST pattern, i am trying to open new line and enter text using sed.
My Existing Text file is Users.txtpaul, Paul Smith, Stevn Smiley, REQ000001, ARS (11)
sam, Sam Martin, Stevn Smiley, REQ000001, ARS (11)
mike, Mike Conway, Stevn... (8 Replies)
Discussion started by: evrurs
8 Replies
6. Shell Programming and Scripting
Hello again everyone,
yes, I'm back again for more help! So I'm attempting to read two separate files and generate some XML code from that. My current code is:
BEGIN {
print "<?xml version=\"1.0\" encoding=\"utf-8\">"
print "<Export>"
}
{
x=1;
print "<section name=\"Query" NR "\">"... (5 Replies)
Discussion started by: Parrakarry
5 Replies
7. Shell Programming and Scripting
Hi Team,
I am new to unix, please help me in this.
I have a file named properties.
The content of the file is :
##Mobile props
east.url=https://qa.east.corp.com/prop/end
west.url=https://qa.west.corp.com/prop/end
south.url=https://qa.south.corp.com/prop/end... (2 Replies)
Discussion started by: tolearn
2 Replies
8. Shell Programming and Scripting
I need help in awk script to do contains search and my requirement is below
I need to check if the value in each column is present in any other column and print it. And in some columns these value could be existing with comma as delimiter.
Sample data... (6 Replies)
Discussion started by: aramacha
6 Replies
9. Shell Programming and Scripting
I am trying to parse a text file and send its output to another file but I am having trouble conceptualizing how I am supposed to do this in awk.
The text file has a organization like so:
Name
Date
Status
Location (city, state, zip fields)
Where each of these is on a separate line in... (1 Reply)
Discussion started by: kellyanneghj
1 Replies
10. Shell Programming and Scripting
Hello.
I would like to convert the following piece of code from bash to awk.
Here are bash variables in a bash script.
CUR_ROW_ID and ROW_ID_TO_SEARCH contains a string which represent a row id.
The string contain a valid row id.
CUR_ROW_ID sometimes may be null.
CUR_VALUE... (3 Replies)
Discussion started by: jcdole
3 Replies
SETREGID(2) BSD System Calls Manual SETREGID(2)
NAME
setregid -- set real and effective group ID
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
setregid(gid_t rgid, gid_t egid);
DESCRIPTION
The real and effective group ID's of the current process are set to the arguments. Unprivileged users may change the real group ID to the
effective group ID and vice-versa; only the super-user may make other changes.
Supplying a value of -1 for either the real or effective group ID forces the system to substitute the current ID in place of the -1 parame-
ter.
The setregid() function was intended to allow swapping the real and effective group IDs in set-group-ID programs to temporarily relinquish
the set-group-ID value. This function did not work correctly; its purpose is now better served by the use of the setegid() function (see
setuid(2)).
When setting the real and effective group IDs to the same value, the standard setgid() function is preferred.
RETURN VALUES
The setregid() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi-
cate the error.
ERRORS
[EPERM] The current process is not the super-user and a change other than changing the effective group-id to the real group-id was
specified.
SEE ALSO
getgid(2), issetugid(2), setegid(2), setgid(2), setuid(2)
HISTORY
The setregid() system call appeared in 4.2BSD.
BSD
April 16, 1994 BSD