Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to pass input from c program to shell script? Post 302594219 by itkamaraj on Monday 30th of January 2012 11:24:51 PM
Old 01-31-2012
If you quote the arguments, then you can easily read the big string as $1 inside the shell script.

Code:
 
$ cat test.sh
echo $1
$ ./test.sh ABC CDE FGG
ABC
$ ./test.sh "ABC CDE FGG"
ABC CDE FGG

 

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
DtWsmChangeBackdrop(API)												  DtWsmChangeBackdrop(API)

NAME
DtWsmChangeBackdrop -- set current workspace's backdrop SYNOPSIS
#include <Dt/Wsm.h> int DtWsmChangeBackdrop( Display *display, Window root, char *path, Pixmap pixmap); DESCRIPTION
The DtWsmChangeBackdrop function works with the CDE workspace manager, dtwm(1), and changes the current workspace's backdrop. Applications can use this function to implement an interface to the workspace manager. If the DtWsmChangeBackdrop function is not successful, the most likely reason for failure is that the CDE workspace manager, dtwm(1), is not running. DtWsmChangeBackdrop sends a message to the CDE workspace manager, dtwm(1), to change the backdrop. The path argument points to a backdrop file name. The file must be in either X Bitmap file format (with extension .bm) or Pixmap file for- mat (with extension .pm). The workspace management services look for the file along the same path used for searching icons. The directory /usr/dt/backdrops is the default directory if the file cannot be found along the icon search path. ARGUMENTS
display display root root window of the screen path file path to bitmap file pixmap pixmap ID of backdrop pixmap SEE ALSO
DtWsm(5) "Communicating with the Workspace Manager" section in the CDE Programmer's Guide "Workspace Manager" section in the CDE Programmer's Overview DtWsmChangeBackdrop(API)
All times are GMT -4. The time now is 12:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy