Programming :: Script By Passing A FILE Without Executing It?

Mar 20, 2010

what i did is created a file called pro3types but the script starts & by pass the file. i added +x to file ran the process but still no luck. i was wondering what else i should change to get the menu to the sub-categories of product3 after users selecting it. all I need to get the pro3types runs after users selecting product3 from the previous menu. need more info please see the thread: "Adding New Selections to the existing Script"

[URL]

but here is code:

Code:

#!/bin/sh
echo SELECTTYPE
export -n selecttypechoice

[code]....

View 5 Replies


ADVERTISEMENT

Programming :: Passing Arguments To A Bash Source File?

Apr 24, 2010

Is it possible to pass arguments to a source file in a bash script? For example

#!/bin/sh
#
. /dir1/dir1/funclib -a -b

How would you check for the passed arguments in funclib without getting confused with any arguments passed to the main script?

View 5 Replies View Related

Programming :: Cuting/executing Text From A File?

Aug 25, 2010

I need a way to read and delete text found before a unique string, then delete the string. I would like to have the text stored in a variable--or better yet--executed it as a shell script directly.I intend to execute the stored text in bash. It does not matter much what language the program is it, however efficiency is desirable. This script is not going to be used on large files, but it may be executed many times sequentially so the faster the script works the better. Here is an example:

exclamation-"It worked!"
echo $exclamation
cd

[code]....

View 7 Replies View Related

Programming :: Passing Class To Itself (CPP)?

May 18, 2010

I'm struggling with the issue of passing a vector of a class to itself, here's what state its in now... (tried many variations, but without direction).

Code:
#include <iostream>
#include <string>

[code]...

View 2 Replies View Related

Programming :: Passing Data Between Php And C

Aug 21, 2010

I'm trying to work out the best way to achieve the following.

1)php page that grabs data from a local database. (not a problem)

2)It then needs to send this data to a c program/service running on a remote server. (I probably need it to be able to handle 4+ million reocrds in an array)

3) The c service then needs to process the data and send it back to the initial php script that called it. i was hoping this could be in a an array like structure of some kind. 4)update the db with the results.

I was thinking of using gsoap to write a simple c soap service that php can communicate with. Would this be the right way of doing this or would something like sockets in php be a better way of sending this volume of data as an array or struct to linux c socket if thats even possible.

View 3 Replies View Related

Programming :: Passing A Source Ip To The Server?

Jan 12, 2011

i'm programming a small tcp client, but i need that the server knows the source ip. My client receives a external connection and forwards, but the ip seen by the server, of course, is the client ip. I would like, change this ip to original source ip.

I don't know how to do this. I tried with the connect and select function.

View 5 Replies View Related

Programming :: Bash - Passing Variable To Ssh?

May 8, 2010

I have a file with around 1000 IP addresses in it and I need to be able to ssh into each one of them, run a single command, and then exit. I already know the ssh command I want to run and it looks like this:

Code:

shpass -p [password] ssh -p 10022 -o StrictHostKeyChecking=no root@[ip variable] 'reboot'

(I know shpass is not good to use and keys are the correct way but I don't have any other options in this scenario.) if these ip addresses were in a .csv file, by themselves with no other information, how would I create a script to do the above command to each ip until the end of the file?

View 8 Replies View Related

Programming :: Parameter Passing In The HTML?

Jun 11, 2010

If I have the following links in HTML

Code:

<a href=lang.php?lang=cymraeg>Cymraeg</a>
<a href=lang.php?lang=english>English</a>

and lang.php has a link to page2.html, how do I pass on the value of the lang parameter from lang.php to page2.html? The value needed is the one passed in to lang.php.

View 3 Replies View Related

Programming :: Passing A Char* By Reference In C++?

Apr 26, 2010

Below I've presented the declaration, definition and the calling method of a function w.r.t pass by reference:

Declaration

Code:

void getUnpackedMsg (unsigned char &data, unsigned int numberOfBits);
Definition
line 278: Shown in RED

Code:

void packedMessage :: getUnpackedMsg (unsigned char &emptyArray, unsigned int numberOfBits)
{
...
...
printf ("

[code].....

View 3 Replies View Related

Programming :: Passing A Variable To Bc In Bash ?

Jan 14, 2009

I cannot for the life of me get this little (simple) script I wrote to work. Here is the entire script:

Code:

#!/bin/bash
ASPECT=`mediainfo $1 |grep "Display aspect ratio" |cut -d : -f 2`
HEIGHT=`echo "320 / $ASPECT" |bc`
SIZE=`echo 320x$HEIGHT`

[code]......

An input filename ($1) is fed into mediainfo, which by the use of grep and cut spits out a single number which is the aspect ratio. This is then divided by bc into 320, which gives the desired height dimension for the file that I want ffmpeg to create for me. Finally, ffmpeg runs using the calculated dimensions... Basically, it's the passing of the $ASPECT variable to bc that seems to fail. It looks like bc won't read the output from the mediainfo line... It always crashes out with:

Code:

(standard_in) 1: illegal character: ^M I've tried doing something even simpler like this to debug by just trying it to display the calculation on the screen:

Code:

#!/bin/bash
ASPECT=`mediainfo $1 |grep "Display aspect ratio" |cut -d : -f 2`
HEIGHT=`echo "320 / $ASPECT" |bc`
echo $HEIGHT

and it does the same, so it's definitely bc that won't accept the output from mediainfo.

View 4 Replies View Related

Programming :: Passing Variables By Reference?

Mar 19, 2010

I was trying to make a code for passing variables by reference..here's the code:

#include<iostream>
using namespace std;
void fun(int& ,int& );
int main(){

[Code].....

invalid initialization of non-const reference of type 'int&' from a temporary of type 'int*'

View 9 Replies View Related

Programming :: Passing Data To A New Thread?

Feb 11, 2011

I have to launch a new thread from my existing main program and pass data to it.
For now the data is simply a string value.

How I go about passing data to a new thread while it is running.

View 5 Replies View Related

Programming :: Passing Values Through Pages?

May 23, 2010

I have the following snippet HTML code:

Quote:

<table id="profile">
<tr>...............</tr>
<tr>
<td width="40%">

[Code].....

How can pass values in args[0] and args[1] to Perl/CGI script?

View 2 Replies View Related

Debian Programming :: Passing Variable Between Invocations

Jan 9, 2014

I want to build on the code from /etc/apt/apt.conf.d/05etckeeper to work with Snapper, the new-in btrfs (et al) snapshot package.

Code: Select allDPkg::Pre-Invoke       { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; };
DPkg::Post-Invoke      { "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi"; };

The etckeeper code will work well as a template, but I need to pass a parameter between the pre- and post- instances. The parameter is obtained from the pre- invocation and passed to the post- invocation.I know that something similar to my quest is done with the 'pid' but how to do it in the 'standard' way. Happily there can't be multiple dpkg instances running concurrently (prevented by dpkg?) so I don't have to worry about that issue.

Q1. What is the 'standard' way of passing parameters about?

Code: Select allsnapper -c etc create -t pre  -p     (which 'prints' the parameter (int) to pass to the following invocation)
snapper -c etc create -t post --pre-number  <parameter>  in place of the two etckeeper calls.

Q2. How do I pick up the 'printed' output of the 'pre' call? I think it's just a 'get' from the stream but perhaps I've missed something.?

View 2 Replies View Related

Programming :: Passing The Char * Vector Argument?

Jun 19, 2010

I am trying to simulate a shell. So what I do is checking of having the parameters from standard input, suc as "/bin/ls -l /home/france/Documents", and then passing them to function execute, which at some point calls execvp(argv[0],argv)The problem is that I don't succeed in using these arguments, while if I call execvp(paramList[0],paramList) it works!!!! Where paramList is exactly what I would put on standard input, but defined statically.

Code:

#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

[code].....

View 2 Replies View Related

Programming :: Passing Input To Program For Test

Apr 13, 2011

I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file. I have got an input from my lecture and she said after compiling in Linux I must write:

1-to compile:
Code:
g++ (files with cpp)
2-to see the output:
Code:
./a.out
3-to test with input:
Code:
./a.out < input.txt >

My problem is in step three. What I must write in the command part after" step2" to see the output?

View 3 Replies View Related

Programming :: Passing An Object To A Running Thread?

Jan 14, 2011

This is a client server issue where the server creates a new thread for listening to a new client, now when the thread starts execution and during its execution the server needs to pass it an object of some X class, how's that to be done?

View 4 Replies View Related

Programming :: Passing Another Program A Password And Username?

May 14, 2010

Are there any security implications in passing a binary unix program a username and password via variables from within a script ?

View 14 Replies View Related

Programming :: Passing Arguments To A Child Process In C++?

Feb 7, 2010

what I am trying to do is to pass an argument to the standard input stream of a child process. I mean I create two programs .. first one invokes the other. second one contains something like

Code:

scanf("%d", &n);

now I want my first program to be able to pass a value to the second one so that it gets stored in n.

View 7 Replies View Related

Programming :: Passing Arguments To System Command?

Dec 17, 2009

I am calling another executable in my application (C programing) using "system" command
which is user interactive program. now i want to pass those args in system command only.

system(" executable ");

Executable will expect 1,2 or 3.

1 is to continue
2 for do changes in settings
3 exit from application

how to pass these in to system command

View 1 Replies View Related

Programming :: Passing Array From One Perl Script To Another?

Dec 14, 2010

How do I pass an array from one perl script to another .. also how to read it in another script ?I tried below -

Script 1 - sender program
system ("./program2.pl @array1 @array2");
printf("

[code]...

View 2 Replies View Related

Programming :: Passing Array To Thread Function?

Aug 12, 2010

I am trying to pass an array to thread program. Its printing the val[0] value but its not printing value at val[1]. Can somebody help me with this problem.

Code:
#include <unistd.h>
#include <stdlib.h>

[code]....

View 4 Replies View Related

Programming :: Passing Commands To Running Daemon?

May 10, 2010

I am working on a daemon that I want to change some variables while its running. Is this possible?I want to implement a command line type interface for my daemon so I can send it commands that will change the current values of specific variables, and also be able tell the daemon to load/save a config file.The only thing I have found so far is passing arguments to a daemon, but that seems to be a one-time shot when your first starting it.

View 6 Replies View Related

Programming :: Passing Info From Mac To Network Layer

Dec 30, 2008

I want to implement a cross layer approach. I want to pass the network information such as delay from the MAC layer to Network layer. Can you tell me the way I am new to this. I am using linux (fedora). I think some system call will do the trick. Correct me if I am wrong. (I want to implement QoS matrices)

View 1 Replies View Related

Programming :: Passing Local Variable Pointers In ASM

Apr 12, 2010

I want to know is there some more efficient way of passing a pointer to a local variable as a parameter to a function in x86 asm? Right now I have to move the base pointer to a temp register, subtract from the register and pass that, like this (assuming a local var at esp-4):

Code:
mov eax, ebp
sub eax, 4
push eax
Is there a better way?

View 8 Replies View Related

Programming :: Passing PHP To Bash Script And Then Back?

Jul 15, 2010

I have a bash script called bash I am trying to execute from PHP. I think I have that right (not sure yet). Ideally let me explain what I am doing. The front end will pass a variable from a text entry box, called New_Task, the New_Task needs to be executed in the bash script and the output needs to be displayed back on the front end. So let me give some code and let me know what you all think.bash code is quite long, but essentially it is made to take a entry and create a task out of it. eg. "svn branch <Task Name>". The code below is getting the New_Task variable passed from the text entry box ($NewTask) and I have an exec for the bash script, but I am not sure it is working, I need to add some code to see the input in the front end.PHP back end code:PHP Code:

function mTaskCreator()
{
$strAction = $this->_objUserContext->mGetPostVar( 'acti

[code]...

View 7 Replies View Related

Programming :: Passing Usb_dev_handle After Fork Exec?

Aug 19, 2010

I have been struggling with this for about a week now. I'm working with QuickUSB to send video streams to and from a device. I get the fastest results by fork()ing and exec()ing new processes everytime I run a pipeline, which works great when reading from files, but now i have to transition it so that i am reading/writing data over a QuickUSB bus. I have it working for each individual process, but i can't run multiple processes because it won't let me open the device. After looking through QuickUSB's API a little closer, i found that the QHANDLE type that they use to describe the usb device is actually just a usb_dev_handle *. From what i have found, this is an incomplete structure, so i am having trouble with opening it in the main process and passing it to each new process to write to it. I already have semaphores set up to prevent multiple processes using it at the same time. I just CANT find out how to utilize the same usb device between two process that are forked and exec. i also must do the exec() because otherwise my gtk and gstreamer fails for trying to share resources.

View 1 Replies View Related

Programming :: Passing Variable To Oracle Query With PHP

Jul 11, 2011

I'm having some trouble this morning to send a SQL query to our Oracle DB server in PHP. When I try to pass my value "OF/110246801A01" as variable it tell's me "Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number"

PHP Code:
$ociO ='OF/110246801A01';
$selectAllFieldsFromOf=oci_parse($conn,"SELECT*FROMMFGOPEWHEREMFGNUM_0LIKE':ociOf' ");
oci_bind_by_name($selectAllFieldsFromOf,":ociOf",$ociOf,15);
$resultQuery =oci_execute($selectAllFieldsFromOf);
if(!$resultQuery){
$e = oci_error($selectAllFieldsFromOf);
return trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);
[Code]....

View 1 Replies View Related

Programming :: Syntax For Passing Arguments In Csh Aliases?

Mar 22, 2009

I want to write a little time-saving alias for my .cshrc file that will move files and then cd to the directory I've moved them to. What I can't quite figure out is the syntax to say 'move all the arguments except the last one.' Here is what I have:

alias follow 'mv !:1-$-1 !:$; cd !:$'

This actually seems to work, but it also gives me an irritating error:

mv: cannot stat `destinationdirectory/-1': No such file or directory

Similarly, I tried:

alias follow 'mv !:*$#argv-1 !:$; cd !:$'

Again the move and cd are successful, but again there is an error:

mv: cannot stat `destinationdirectory/0-1': No such file or directory

View 1 Replies View Related

Programming :: GNU C - Timer Not Executing

Mar 3, 2011

Why is the timer not executing?

Code: #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include <pthread.h>
void func(union sigval sv)
[Code]....

View 1 Replies View Related







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