Programming :: Change The $PWD Using Execve()?

Feb 23, 2010

I had a doubt about the role of the evironment set in the execve() function of the C languange.

If I run something like

Code:
#include <stdio.h>
#include <unistd.h>
int main(void) {

[Code]....

What is the utility of setting the environment in the execve()?

Is there another way (not using chdir()) of changing the current directory before running exec()?

View 5 Replies


ADVERTISEMENT

Programming :: Open() Syscall Breaks Execve()'s Work?

Jul 16, 2010

here is my working code :

Code: #include <stdio.h>
#include <stdlib.h>
#include <string.h>

[code]....

View 3 Replies View Related

General :: Stat File For Permissions - Fork() Or Execve()?

May 6, 2011

When a application is ran from the shell:fork() is calledexecve() is calledI know the shell stats the file to make sure the required permissions are allowed in the child shell. But I can not find this in the man fork. Nor can I find this in man execve. Which one of these processes/calls stats the binary to be ran?

View 1 Replies View Related

Programming :: Using Sed To Change Strings?

Sep 3, 2010

I am having a lot of problems trying to change one string by another using sed: the sentence is like this:

sed -i 's/KERNEL=="tty[A-Z]*", NAME="%k", GROUP="uucp", MODE="0660"/KERNEL=="tty[A-Z]*", NAME="%k", GROUP="uucp", MODE="0666"/g' 50-udev.rules
it is just to fing the line with:
KERNEL=="tty[A-Z]*", NAME="%k", GROUP="uucp", MODE="0660"

[code]....

View 8 Replies View Related

Programming :: C Tcp Header Change?

Jul 25, 2011

I am trying to write a program that will send a packet to a server as a different IP address so I can test my firewall rules as I only have access to a couple of machines:

Code:
int my_socket;
struct sockaddr_in sin;

[code]....

View 2 Replies View Related

Programming :: Variable Name Change In A Loop?

Apr 24, 2010

I am about to move my scripts to the next generation level, so I need some help I am stuck in varying my variable names in a loop. For example:

for user in ben dorothy mike pat
do
[ -r /home/$user ] && let "$user"check=1 || let "$user"check=0

[code]...

View 1 Replies View Related

Programming :: Unable To Change Affinity

Apr 29, 2010

I am using glib version 1.2.10.I came to know from somewhere that "pthread_attr_setaffinity_np(3)" does not work on this version for POSIX threads. Following error was coming:(.text+0x112): undefined reference to `pthread_attr_setaffinity_np'collect2: ld returned 1 exit status.All I want to do is to run 2 threads on two different processors. I cannot change the glib version.

View 3 Replies View Related

Programming :: Change String Variable In Awk?

Nov 26, 2010

How to change string variable in awk? for example, I parse with awk script text file named some_name_with_extension.txt

I want to print only some_name in my script

Code:
....
varCompName = FILENAME
print varCompName

How to put not all symbols from FILENAME to variable?

[Code].....

View 3 Replies View Related

Programming :: Change Mutiple Xml Files?

Apr 21, 2010

I'm trying to change a line of a bunch of xml files (more than 800).What I want isto change this line:

Code:
<variable name="reliability" size="1">96</variable>
to

[code]...

View 1 Replies View Related

Programming :: Change The Prompt Of Shell Through C?

Oct 30, 2010

I have an assignment that I have to change the prompt of shell through C.

View 11 Replies View Related

Programming :: Change MAC Address Via C Code?

Apr 12, 2010

I need a way to change the machine MAC address via a C code in linux. Ive find a way to retrieve it but not to change it.

View 4 Replies View Related

Programming :: Change Directory In System With Java?

Mar 12, 2011

I am trying to run the configure command to install a package in linux with Java. Now my workspace location of Eclipse project is /home/user/Workspace/projectx. The source package say zebra is located in /project/test/zebra. Now there is a configure script which I want to run using java and all the outout files will also be created in /project/test/zebra.
Now in Java the code I am using runs the configure command but all the files it creates in current workspace of project which is in /home/user/Workspace/projectx directory.
Now as I tried to do 'cd' command but as it's internal command of linux so it doesn't work and I don't know how to make it work. code...

View 8 Replies View Related

Programming :: Change Priority When Creating New Thread?

Feb 21, 2010

I have created an error logger thread in my application using pthread_create(), I want this thread to have a lower priority than my application's priority so that the application would run properly. Is there an easy way to do this? I know that we can change priority for thread created with policies FIFO or RR, since I don't set the policy for my application, I don't know what to set for my thread.

View 4 Replies View Related

Programming :: Change Running Path In Bash

Feb 5, 2010

We have a custom app that runs on boot on some older hardware running DSL linux, and their startup manager was quite simple. We purchased some newer Asus eeebox's which run xandros and things are quite stable and run nice with 1 exception.The application only runs from the root (/) location. This box auto logs in as 'user' and there is a /home/user/.kde/Autostart folder where you can stick scripts to run at boot. So I have a start.sh script, and with little bash programming tried things such as;
sudo cd /
sudo /startapp.pl

but the errors start spewing with the basic;can't find data/xyz as it's looking in the local.I thought there was a basic cwd (change working directory) but everything I try just forces the run from that location.Any ideas or suggestions are appreciated, but things like can you change the code, etc. can't be done, so it must be a programming thing. The only other thought I had but not sure, can you do a cronjob with @boot or something, that when the box starts, it can run this job as root and fire off?

View 3 Replies View Related

Programming :: Change Variable In Case Command?

Aug 7, 2010

I want to display 4 options using the case command and refresh the screen when options 1 and 2 are chosen (no changes to the options and you get asked again to chose option), but give a message for option 3 and exit on option 4. I set this up with the script below, but choosing option 1 works and choosing option 2 exits the script.

Code:

#!/bin/bash
#testing options
Option="0"

[code]....

View 7 Replies View Related

Programming :: GTK - Change The Font Of GtkButton Label?

Nov 15, 2010

I used gtk_bin_get_child to change the font of GtkButton label. It worked properly but when I added an image to the button it didn't work.

View 3 Replies View Related

Programming :: GTK+: GtkButton And GtkList Change Font?

Nov 17, 2010

I used gtk_bin_get_child and gtk_widget_modify_font to change the font of GtkButton. They worked properly but when I added an image to the button, they do not work.I also want to change the font of GtkList widget, but I don't know how to do this.Please, answer the questions if you know and do not say your idea about my religious statement because we live in the free world and everyone can speek and write freely

View 2 Replies View Related

Programming :: GTK+: Change The Alignment Of GtkTreeView Widget?

Oct 17, 2010

I want to change the alignment of GtkTreeView widget(Right-to-Left algin) i.e add columns to the rifgt of GtkTreeView and change the title of the column and its content to the rifgt of the column but I do not know how to do it

View 1 Replies View Related

Programming :: Change Info In A Text File Using C++?

Jan 16, 2011

how to work properly on the windows forms application in c++.

the thing is that i was able to produce in the windows forms application a web browser and I added a save button. So know I am able to navigate predeclared webpages such as [URL]and then I entered google's search box such as "spread of H1N1". and I surf a page such as [URL] I later save the page as text file on my computer.

I wanted to know how to organize the words in the text file ? i mean how can i just get the number of infected people in USA , number of infected in CANADA (if they exist) from all the text file and change it to a file with precise data.that is to eliminate the unneeded information such as the the characteristics and the useless ideas? and what if i also wanted to know the characteristics of the virus in a country+the number of infected?. How can i do it?

View 3 Replies View Related

Programming :: Change The Background Of A Webpage In Ajax?

Jan 22, 2011

when the "Submit" button is clicked on a form in the webpage, I'd like the background tiled image to be changed to another one (downloaded from the server, and "activated"), and the logo that I have there also replaced by another one, which will also have to be downloaded from the server.

View 1 Replies View Related

Programming :: Monitor A Folder For New / Change Files?

Aug 30, 2010

how I can monitor a folder and get the name of newly created files or files that their size is changing? (in Perl or Linux shell script)

View 5 Replies View Related

Programming :: Script To Change Column Data?

May 14, 2010

i have a compiled data as follows:

c1
0
0
0

[Code]......

View 13 Replies View Related

Programming :: Sed To Change Character In Text File Only Once?

Sep 7, 2009

I have a script that looks like:

Code:

cat servers.txt
trivia:P:N
trivia:D:N
tucana:P:Y

[code]....

I want to be able to find the lines that matches my input and change the N to a Y, but only for the lines that matches the name and not any other N's My problem is the line does not always contain a P as it can be a D as well so my matching did not work. If my script issues the name $1=triva the lines will change to:

Code:

trivia:P:Y
trivia:D:Y

I have the following code so far but as you can see it does not change the D's

Code:

sed -i 's/trivia:P:Y/trivia:P:N/g' servers.txt

*** UPDATE ***

should I be using a method as follows? I am still stuck on the changing all instances though.

Code:

$1=server
sed -i 's/$server1:P:Y/$server:P:N/g' server.txt
sed -i 's/$server1:D:Y/$server:D:N/g' server.txt

View 7 Replies View Related

Programming :: Source Code For Cd - Change Directory

Feb 9, 2010

I want to modify the source of cd (the 'change directory' command) to do a little extra for me, but I can't seem to find the source code anywhere.. maybe I didn't look for it well enough, and googling "source code cd" and variants of that doesn't exactly help... I was wondering if anyone knew where I could find the src?

View 14 Replies View Related

Programming :: Change Correctly The Script For The Tarfile Module?

Sep 17, 2010

I've fixed an tarball damaged and now obtain many file with the same name into; I tried to create a script based on a previous originally based on the "zipfile" module:

original:

Code: #!/usr/bin/env python
import os
import sys
import tarfile

[code]....

but obtain error becouse the tarfile has not the attribute "infolist" how i could change correctly the script for the tarfile module?

View 3 Replies View Related

Programming :: Fortran 90 Code - Makefile Insensitive To Change

Mar 10, 2011

I am dealing with one FORTRAN 90 code, have made small changes.

milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ ifort -c MT2DDIB1.FOR
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.

I go for make command but it does not see that the source code has been modified.Than I do compilation from command line,try make again but no use.
F95=ifort
FFLAFGS= -O1

mt3: driver_mt2ddi.o constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -o $(FFLAGS) mt3 constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o driver_mt2ddi.o
driver_mt2ddi.o: driver_mt2ddi.for constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -c $(FFLAGS) driver_mt2ddi.for

View 2 Replies View Related

Programming :: Change To Lower Case And Concatenate The First And Last Names?

Nov 28, 2010

I have a file like below. For all the lines (except for the ones listed as 'Unknown Owner' and N/A') I would like to change to lower case and concatenate the first and last names.Before:

Code:
aaa.bbb.ccc.ddd,Unknown Owner
ddd.eee.fff.ggg,N/A
hhh.iii.jjj.kkk,John Doe
aaa.bbb.ccc.ddd,Mary Jane

[Code]...

View 4 Replies View Related

Programming :: Put A Variable In The $PS1 Prompt That Will Change Each Time A Command Is Run?

Feb 11, 2011

I would like to put a variable in the $PS1 prompt that will change each time a command is run. I want the color of the $PS1 prompt to change each time a command is run.I know that I can do this:

Code:
PS1="h@w # "
## "#" is changes every time a command is run

[code]....

View 9 Replies View Related

Programming :: Change Data Format In A File Using Bash?

Mar 24, 2010

I want to change data format in a file using bash. The orignal is like:

Code:
1 abc 6 pqr
2 def 7 stu
3 ghij 8 vwx
4 kl 9 yz

[Code]....

View 9 Replies View Related

Programming :: Change / LINK Text To Yellow , White , Red?

Apr 25, 2009

Can anyone tell me how to change the LINK text to yellow or white or red??
The page is ( http://www.multidistro.com ) code...

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved