Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to pass input from c program to shell script? Post 302594209 by itkamaraj on Monday 30th of January 2012 11:06:30 PM
Old 01-31-2012
give a try..

Code:
sprintf(str,"\"sh st1.sh %s\"",charadd1);

---------- Post updated at 09:36 AM ---------- Previous update was at 09:33 AM ----------

or you can read about the popen function

popen function
This User Gave Thanks to itkamaraj For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

pass the input to invoking script

How to pass the input to the execution script ex: test1.sh contains #! usr/bin/sh read val echo $val test2.sh contains #! /usr/bin/sh ./test1.sh now I am calling test2.sh thro command line and I want to pass the input to the script test1.sh from test2.sh ..I mean not... (6 Replies)
Discussion started by: vastare
6 Replies

2. Programming

How to pass C array as input to Shell script

Hi, In the below C code , i want to pass the array to a unix shel script. my script should called as ex myscript 1,2,3 #include <stdio.h> int main() { int a={1,2,3}; } Thanks, Arun (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

3. Shell Programming and Scripting

Can we pass an array of strings from a Perl Program to a Shell Script?

Hi Folks, The subject is my question: Can we pass an array of strings from a Perl Program to a Shell Script? Please provide some sample code. Thanks ---------- Post updated at 11:52 PM ---------- Previous update was at 11:43 PM ---------- I got it. Its here:... (0 Replies)
Discussion started by: som.nitk
0 Replies

4. Shell Programming and Scripting

Launching a C program that needs input from a shell script

hi there, i need some help, i am trying to run a script to launch a C program and a Java program but before running both I want to get a user input and then invoke both programs with input received. In the programs the inputs are not command line arguments. This is the code, after the java... (4 Replies)
Discussion started by: momal
4 Replies

5. Shell Programming and Scripting

Call java program from shell and pass values

Hi All, Can anybody please help me with how can i call my java program from shell and also pass parameter along with it so that the program can interpret the value/int and update the database. Thanks in advance Neha (1 Reply)
Discussion started by: Neha Goyal
1 Replies

6. Shell Programming and Scripting

Shell script to input as if from command line to the java program

Hi, We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5. However i want to always enter "1" and write another shell program wrapper to start... (4 Replies)
Discussion started by: surya5kn
4 Replies

7. Shell Programming and Scripting

Write a shell program with input

Hi, Here is my question: I want a shell script which I name as 'del', and can be used as del(string). when run del(string), it will delete several directories at different locations in my system,like: rm -fr /lustre/fs/scratch/user/$string rm -fr /home/user/$string rm -fr... (4 Replies)
Discussion started by: 1988PF
4 Replies

8. Shell Programming and Scripting

Seeing input that you redirect to a program on the shell

Suppose I have a program that I've written that accepts input, ie this C++ program: #include <iostream> using namespace std; int main() { cout << "Enter something:" << endl; int x; cin >> x; cout << "You entered data" << endl; } Suppose that I have a text file,... (5 Replies)
Discussion started by: Chris J
5 Replies

9. Shell Programming and Scripting

Read input from file and pass it to sub shell

i have a scenario where in i have to monitor jobs which run in different servers, The job details(job name, host server, etc) are present in a dat file. I have written a script a script which reads the details from the dat file and calls a local method where the job monitoring logic is present.... (2 Replies)
Discussion started by: abubucker0
2 Replies

10. Shell Programming and Scripting

How pass the input parameter to a file in the script ?

OS version: RHEL 6.7 myTextFile.txt file is referred within Script1.sh script, I only execute Script1.sh and I want the input variable to be passed inside myTextFile.txt . Any idea how I can do this ? $ cat script1.sh cat myTextFile.txt $ cat myTextFile.txt $1 Requirement1.... (4 Replies)
Discussion started by: kraljic
4 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy