Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I execute a command inside ROOT that I launch within the bash script? My aim is to have ROOT execute its GUI file browser and have it open if the user does not interfere with keyboard commands. I tried but failed since the GUI file browser stays open for a really short period of time. Is it possible that I modify the bash script and have the program open when the script terminates?

The description of ROOT can be found in the following link:

http://root.cern.ch/drupal/

share|improve this question

closed as unclear what you're asking by Gilles, maxschlepzig, Braiam, Michael Homer, derobert Aug 2 at 2:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Yes, a program can execute another program. What program is it? Your question is as vague as “can I drive a car on a road”. What is your actual question? –  Gilles Aug 1 at 22:04
    
@Gilles I edited the question for clarity, thanks for pointing out the ambiguity. –  Vesnog Aug 1 at 22:17
    
Your question is still unclear. If program A has a command prompt, type the command at the command prompt. You seem to be running into some kind of problem, but you need to tell us what that problem is. –  Gilles Aug 1 at 22:19
    
@Gilles Yes program A has a command prompt and I invoke the command by using the construct EOF, but when program A is closed without my interference and I would like to have it open as much as I please. Thanks for your interest by the way. –  Vesnog Aug 1 at 22:26
    
It seems that program A is doing something peculiar. What is program A? You need to give us the information! –  Gilles Aug 1 at 22:46

1 Answer 1

just type the command and it will be executed:

#!/bin/bash
ls -l

if you want to run other shell scripts use:

sh otherShell.sh

or for executable files:

. otherShell.sh

gnuplot is as other commands, you can use it inside shell script:

Example:

#!/bin/sh
lib=$1
old="output/old/$lib.dat"
new="output/new/$lib.dat"

gnuplot << EOF
set logscale x
set logscale y
set size square
set grid
set pointsize 1
plot "< paste $old $new" using 1:4 ti '$lib'
EOF

for the problem "it was giving no time for view and interaction with the GUI launched within the application": you can tell gnuplot to print the plot to file, which you can open up and view yourself:

plot '<SOME FILE>' .......

Or you need to invoke gnuplot with a flag:

gnuplot --persist

to ensure that plots stay up after gnuplot quits.

Sources:

automate gnuplot plotting with bash

http://www.unix.com/shell-programming-and-scripting/146860-using-variables-gnuplot-within-shell-script.html

share|improve this answer
    
My point is that I will launch an application with the command say GNUplot ,it will be ROOT Data Analysis Framework in my case, and pass some command to be executed inside GNUplot. –  Vesnog Aug 1 at 22:05
    
Thanks for the edit it will be helpful, I think this will also work with other programs. –  Vesnog Aug 1 at 22:09
    
@Vesnog Yes as I know. –  Networker Aug 1 at 22:10
    
It works as intended but the application is closed immediately, giving no time for view and interaction with the GUI launched within the application(ROOT). –  Vesnog Aug 1 at 22:23
    
@Vesnog, see Updates –  Networker Aug 1 at 22:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.