Sponsored Content
Full Discussion: shell commands in c program
Top Forums Programming shell commands in c program Post 86549 by Perderabo on Saturday 15th of October 2005 05:38:41 AM
Old 10-15-2005
Also look at the man page for system(). It lets you run a command easily, but you can't do i/o to or from the command.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

combining unix commands and awk program

Dear Experts I am trying to find if it is possible to combine unix commands in awk program. For example if it is possible embed rm or ls or any unix command inside the awk program and while it is reading the file besides printing be able to do some unix commands. I am thinking may be just print... (2 Replies)
Discussion started by: Reza Nazarian
2 Replies

2. UNIX for Dummies Questions & Answers

How to use UNIX commands in C program

Hai friend, I am new to linux..i had gone through most of the commands used in unix but i dont know how to use this commands in my C program..U know about this plz send the example program(C prog with unix command)... Thank... (3 Replies)
Discussion started by: sundar.lsr
3 Replies

3. Shell Programming and Scripting

HELP: Need to send commands to Program

Hi, I am an absolute beginner in Unix and I need to send a commands to a program I have created a script that will let me login to the program, however, i cannot get the script to send commands to this program. When the cript logs into the program, the display/ prompt is as follows: 1>... (1 Reply)
Discussion started by: the_m4ch1ne
1 Replies

4. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

5. UNIX for Dummies Questions & Answers

Can anyone help? I have to Write a program in C that recognizes the following commands and translate

I have to Write a program in C that recognizes the following commands and translates them into much simpler ones Commands to recognize shorter command list L cd dir C - dir_length - dir get file_name G - file_name_length - file_name Long commands are read from the standard input and... (1 Reply)
Discussion started by: aintour
1 Replies

6. Homework & Coursework Questions

Can anyone help? I have to Write a program in C that recognizes the following commands and translate

I have to Write a program in C that recognizes the following commands and translates them into much simpler ones Commands to recognize shorter command list L cd dir C - dir_length - dir get file_name G - file_name_length - file_name Long commands are read from the standard input... (1 Reply)
Discussion started by: aintour
1 Replies

7. UNIX for Dummies Questions & Answers

How to run two commands from a exec call in a c program

Hi, I have to run two commands one after another from a c program. How can i do this with exec system calls. i tried giving them as argument to execv but it is not working.please help thanks (3 Replies)
Discussion started by: suryashikha
3 Replies

8. Shell Programming and Scripting

How to enter commands to the command prompt in a program

Hey, So I'm trying to write a program in unix to automate a process for my astrophysics research. Basically I want the program to prompt the user for some information and store the entered string of text as a variable. I know how to do this. This is where I need help: Now lets say I have a... (4 Replies)
Discussion started by: freemoniez
4 Replies

9. Shell Programming and Scripting

Automating execution of commands inside a program

I have a program dnapars I execute the program from command line as following: ./dnapars The program then prompts me some message as a user menu from where I have to select a series of options in the order R U Y R. And then I copy the output file (outfile) in another result file. I wrote the... (3 Replies)
Discussion started by: deeptisjains
3 Replies

10. Shell Programming and Scripting

[Solved] Usage of shell commands inside a C program

Hi I have a program int main(int srgc, char *argv) { for(int i=1; i<50; i++) { system("dd if=/dev/zero of=file$i bs=1024 count=$i"); } return 0; } My doubt is how to use the "$i" value inside C code Please help (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
S390_RUNTIME_INSTR(2)						System Calls Manual					     S390_RUNTIME_INSTR(2)

NAME
s390_runtime_instr - enable/disable s390 CPU run-time instrumentation SYNOPSIS
#include <asm/runtime_instr.h> int s390_runtime_instr(int command, int signum); DESCRIPTION
The s390_runtime_instr() system call starts or stops CPU run-time instrumentation for the calling thread. The command argument controls whether run-time instrumentation is started (S390_RUNTIME_INSTR_START, 1) or stopped (S390_RUN- TIME_INSTR_STOP, 2) for the calling thread. The signum argument specifies the number of a real-time signal. The real-time signal is sent to the thread if the run-time instrumentation buffer is full or if the run-time-instrumentation-halted interrupt occurred. RETURN VALUE
On success, s390_runtime_instr() returns 0 and enables the thread for run-time instrumentation by assigning the thread a default run-time instrumentation control block. The caller can then read and modify the control block and start the run-time instrumentation. On error, -1 is returned and errno is set to one of the error codes listed below. ERRORS
EINVAL The value specified in command is not a valid command or the value specified in signum is not a real-time signal number. ENOMEM Allocating memory for the run-time instrumentation control block failed. EOPNOTSUPP The run-time instrumentation facility is not available. VERSIONS
This system call is available since Linux 3.7. CONFORMING TO
This Linux-specific system call is available only on the s390 architecture. The run-time instrumentation facility is available beginning with System z EC12. NOTES
Glibc does not provide a wrapper for this system call, use syscall(2) to call it. SEE ALSO
syscall(2), signal(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux Programmer's Manual 2017-09-15 S390_RUNTIME_INSTR(2)
All times are GMT -4. The time now is 05:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy