Sponsored Content
Top Forums UNIX for Dummies Questions & Answers I am not able to use variables in system command in a C program Post 302760503 by RudiC on Thursday 24th of January 2013 06:28:32 AM
Old 01-24-2013
Pls use code tags as advised.
You did not read what I wrote. Put everything into a new variable and supply that (I think by reference) to the system call.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Dump program variables

Hi, Wish if could provide some clues. How do I dump all the C program variables(global) into say a file with their names and the values. So that when I restart the application again I could use this same file for reinitializing.Is this possible? Thanks, Reji (1 Reply)
Discussion started by: rejise
1 Replies

2. UNIX for Dummies Questions & Answers

Dummie: How do I get variables mid program

I'm writing a simple program in unix and was wondering how mid switch I can run a program and get someone to enter variables for it i.e.: #!/bin/csh -f echo "If you wish to do v press v" echo "If you wish to compile press c" echo "If you wish to add an entry press a" echo "If you wish to... (1 Reply)
Discussion started by: RichardB
1 Replies

3. Shell Programming and Scripting

Passing shell variables to awk program..

Hello, Can we pass shell variables like $PATH etc. to a awk program part for example, awk ' { fieldValue=$PATH .... }' file (1 Reply)
Discussion started by: Vishnu
1 Replies

4. Programming

using system cp command in C program

Hi i used the following code to copy a directory from a source location to dest. argv contains the source loc i/p by the user. strcpy(source,argv); strcpy(dest,"/home/MainServer/Job_dir/"); system("cp -r $source $dest"); it complies properly but during execution of the program it... (2 Replies)
Discussion started by: mridula
2 Replies

5. Shell Programming and Scripting

How to access the C program variables in shell script

hi I wanted to access the C program variables in shell script. This script is called from the same C program. What are the ways in which i can access variables thankx (3 Replies)
Discussion started by: bhakti
3 Replies

6. Shell Programming and Scripting

problem accessing Multiple Variables from C Program to a Shell script

program name--test #!/bin/bash output1=`/home/user/a.c` output2=`/home/user/a.c` k=`$output1 + 1` m=`$output2 + 1` echo $k echo $m --------------------------------------------------------------------------- prgram name--a.c #include<stdio.h> int main() (1 Reply)
Discussion started by: sameworld1980
1 Replies

7. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

8. UNIX for Dummies Questions & Answers

Small Program with variables

Hello Geniuses of the unix world. please help, stupid chemist. I have the following script that I need to create a file. Doesnt make sense unless i explain this way: I need to create a file called summary.in I would like all these lines to be inserted however in the command line I would like the... (1 Reply)
Discussion started by: gingburg
1 Replies

9. UNIX Desktop Questions & Answers

Knowing the size and location of variables in a C program

So I need some help with this. Pardon me if I'm posting in the wrong forum, after some googling for my answer and finding nothing I found this forum. It seemed appropriate for what I was seeking. I just didnt find a forum that concerned the use of GDB. I'm learning to use the C language and GDB.... (2 Replies)
Discussion started by: Cambria
2 Replies

10. Shell Programming and Scripting

Using env variables to run a program

Hi there, I need urgent help with a small program that is run via shell script. Unfortunately I only understand the bare basics of shell scripting and can't figure out how to do this. We have a program that tests the connection between 3 servers. I have a script that lets the program run on... (15 Replies)
Discussion started by: Pherdinand
15 Replies
REF(1)							      General Commands Manual							    REF(1)

NAME
ref - Display a C function header SYNOPSIS
ref [-t] [-c class]... [-f file]... tag DESCRIPTION
ref quickly locates and displays the header of a function. To do this, ref looks in the "tags" file for the line that describes the func- tion, and then scans the source file for the function. When it locates the function, it displays an introductory comment (if there is one), the function's declaration, and the declarations of all arguments. SEARCH METHOD
ref uses a fairly sophisticated tag look-up algorithm. If you supply a filename via -f file, then elvis first scans the tags file for a static tag from that file. This search is limited to the tags file in the current directory. If you supply a classname via -c class, then elvis searches for a tag from that class. This search is not limited to the current direc- tory; You can supply a list of directories in the environment variable TAGPATH, and ref will search through the "tags" file in each direc- tory until it finds a tag in the desired class. If that fails, ref will then try to look up an ordinary global tag. This search checks all of the directories listed in TAGPATH, too. If you've given the -t flag, then ref will simply output the tag line that it found, and then exit. Without -t, though, ref will search for the tag line. It will try to open the source file, which should be in the same directory as the tags file where the tag was discov- ered. If the source file doesn't exist, or is unreadable, then ref will try to open a file called "refs" in that directory. Either way, ref will try to locate the tag, and display whatever it finds. INTERACTION WITH ELVIS
ref is used by elvis' shift-K command. If the cursor is located on a word such as "splat", in the file "foo.c", then elvis will invoke ref with the command "ref -f foo.c splat". If elvis has been compiled with the -DEXTERNAL_TAGS flag, then elvis will use ref to scan the tags files. This is slower than the built-in tag searching, but it allows elvis to access the more sophisticated tag lookup provided by ref. Other than that, external tags should act exactly like internal tags. OPTIONS
-t Output tag info, instead of the function header. -f file The tag might be a static function in file. You can use several -f flags to have ref consider static tags from more than one file. -c class The tag might be a member of class class. You can use several -c flags to have ref consider tags from more than one class. FILES
tags List of function names and their locations, generated by ctags. refs Function headers extracted from source files (optional). ENVIRONMENT
TAGPATH List of directories to be searched. The elements in the list are separated by either semicolons (for MS-DOS, Atari TOS, and Amiga- Dos), or by colons (every other operating system). For each operating system, ref has a built-in default which is probably ade- quate. NOTES
You might want to generate a "tags" file the directory that contains the source code for standard C library on your system. If licensing restrictions prevent you from making the library source readable by everybody, then you can have ctags generate a "refs" file, and make "refs" readable by everybody. If your system doesn't come with the library source code, then perhaps you can produce something workable from the lint libraries. SEE ALSO
elvis(1), ctags(1) AUTHOR
Steve Kirkendall kirkenda@cs.pdx.edu REF(1)
All times are GMT -4. The time now is 05:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy