Search Results

Search: Posts Made By: Andrewkl
10,397
Posted By Andrewkl
'cp' command: preserve group ownership
Hi,

Here is the scenario:

This file exists, with this ownership and group:
-rw-rw-r-- 1 picard starfleet 4 Jan 3 00:33 myfile.txt
Output of the 'id' command for user picard is:
...
1,345
Posted By Andrewkl
Perl script: use statements and system glitch
hi,

i have a perl script that runs as a cron job... Once in a while, the perl
script fails with:

Can't locate <module>.pm in @INC (@INC contains: .............)

because one of the perl...
1,826
Posted By Andrewkl
question about zsh
hi,

In bash,


$ bind -P | grep yank-last
yank-last-arg can be found on "\M-.", "\M-_".


this allows me to press ALT key and the period (.) to yank the last argument of
the previous...
Forum: Programming 01-20-2009
4,505
Posted By Andrewkl
help with realloc() on Linux
hi,

Not sure what size to give. I increased it:


tmpptr = (char*) realloc (contents, lFileLen * sizeof(char) + 99);


but the above doesn't help.
the problem seems to be related to the...
Forum: Programming 01-20-2009
4,505
Posted By Andrewkl
help with realloc() on Linux
hi,

I'm using gcc version 3.4.6 on a Red Hat system... (not sure how to determine version of glibc)
when i run the following, i get:


glibc detected *** realloc(): invalid next size:...
Forum: Programming 01-20-2009
17,960
Posted By Andrewkl
returning multiple values from a function in C
I see what i did wrong.
thank you all for your responses.

--Andrew
Forum: Programming 01-18-2009
17,960
Posted By Andrewkl
returning multiple values from a function in C
i mentioned in the code comment that this is only a demo and that 'id' is used in my real code.

anyway, i did a malloc() in main. this got rid of the coredump, but still
there are no values...
Forum: Programming 01-17-2009
17,960
Posted By Andrewkl
returning multiple values from a function in C
hi

how can I return multiple values from a C function. I tried the following:


#include <stdio.h>
void foo(int id, char *first_name, char *last_name)
{
/*
this is just an example to...
27,371
Posted By Andrewkl
hi, Thank you for the tip. I am able to...
hi,

Thank you for the tip.

I am able to read in the contents of the "cmdline" file into a variable,
but when I try to print out the string, the output shows only characters before
the first...
7,013
Posted By Andrewkl
thanks for the responses. I am able to get what...
thanks for the responses. I am able to get what i need now.

--Andrew
27,371
Posted By Andrewkl
Retrieving command line arguments of a particular PID
hi

The "ps" command shows the command line arguments of running processes:

$ /bin/ps -o pid,args -e
....
26031 pico /tmp/crontab2KaG1Y
596 /usr/lib/sendmail -bd -q15m
9955 xterm -n 1 -sb...
7,013
Posted By Andrewkl
retrieving all group names with a given group number
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:...
9,301
Posted By Andrewkl
it shouldn't matter which user owns the...
it shouldn't matter which user owns the directory. The user (target user) I'm running the command as
belongs to the same group that owns the directory, but the OS is not recognizing the
target...
9,301
Posted By Andrewkl
thanks for the reply. However, your suggestion...
thanks for the reply. However, your suggestion only works if all users
belong to a common group. If i wish to run a command as 'billybob' and 'billybob' doesn't belong to 'starfleet' group, I'll...
9,301
Posted By Andrewkl
Running a Unix command as a different user
hi,

I wrote a C program (runas.c) that runs a command as a different user.
The problem I'm having is that the new user's group membership isn't going into
effect. Take the following...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 11:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy