LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2011, 04:58 AM   #1
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Rep: Reputation: 0
Unhappy execute commands after run command


I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??
 
Old 01-13-2011, 05:02 AM   #2
truboy
Member
 
Registered: Oct 2010
Location: Switzerland
Posts: 84

Rep: Reputation: 9
Quote:
Originally Posted by ajeesh.tr View Post
I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??
Show us the script/part of the script you're talking about.
 
Old 01-13-2011, 05:09 AM   #3
an15wn
LQ Newbie
 
Registered: Dec 2010
Location: Jakarta, ID
Distribution: Fedora, Ubuntu
Posts: 18

Rep: Reputation: Disabled
Double thread:
http://www.linuxquestions.org/questi...8/#post4222734

-----

Maybe you must 'debug' it step by step. If that is plain shell script, you can test it by doing one command by one.
 
1 members found this post helpful.
Old 01-13-2011, 05:25 AM   #4
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by truboy View Post
Show us the script/part of the script you're talking about.
mono --debug /home/sam/axx.exe install
cp file /home/sam/
 
Old 01-13-2011, 07:01 AM   #5
truboy
Member
 
Registered: Oct 2010
Location: Switzerland
Posts: 84

Rep: Reputation: 9
Quote:
Originally Posted by ajeesh.tr View Post
mono --debug /home/sam/axx.exe install
cp file /home/sam/
And what is not working ?

Quote:
I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??
- By "a run command", you mean
Code:
mono --debug /home/sam/axx.exe install
- By "the remaining commands", you mean
Code:
cp file /home/sam/
Am I right ?

Last edited by truboy; 01-13-2011 at 07:02 AM.
 
Old 01-13-2011, 07:12 AM   #6
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 836

Rep: Reputation: 200Reputation: 200Reputation: 200
The OP is saying that `mono` executes in a spawned shell and doesn't return to the calling shell and so he is not able to execute next command which is "cp file /home/sam/" isn't executing.

. mono ... ?
 
Old 01-13-2011, 07:21 AM   #7
truboy
Member
 
Registered: Oct 2010
Location: Switzerland
Posts: 84

Rep: Reputation: 9
Quote:
Originally Posted by AnanthaP View Post
The OP is saying that `mono` executes in a spawned shell and doesn't return to the calling shell and so he is not able to execute next command which is "cp file /home/sam/" isn't executing.
Thanks for the details !

You should try :

Code:
$ mono --debug /home/sam/axx.exe install &
$ cp file /home/sam/
Or, if mono needs some time before creating file :

Code:
$ mono --debug /home/sam/axx.exe install &
$ sleep 5
$ cp file /home/sam/
 
Old 01-17-2011, 12:48 AM   #8
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by truboy View Post
And what is not working ?



- By "a run command", you mean
Code:
mono --debug /home/sam/axx.exe install
- By "the remaining commands", you mean
Code:
cp file /home/sam/
Am I right ?

Yeah you are right..
 
Old 01-17-2011, 12:49 AM   #9
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by truboy View Post
Thanks for the details !

You should try :

Code:
$ mono --debug /home/sam/axx.exe install &
$ cp file /home/sam/
Or, if mono needs some time before creating file :

Code:
$ mono --debug /home/sam/axx.exe install &
$ sleep 5
$ cp file /home/sam/
I tried that it is not working.
 
Old 01-17-2011, 12:53 AM   #10
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AnanthaP View Post
The OP is saying that `mono` executes in a spawned shell and doesn't return to the calling shell and so he is not able to execute next command which is "cp file /home/sam/" isn't executing.

. mono ... ?
Thank you for your reply,that is the exact issue,
mono is a command for command line execution of Mono Develop IDE ,by mono --debug is equivalent command for "Run" in the IDE
 
Old 01-17-2011, 01:05 AM   #11
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ajeesh.tr View Post
I tried that it is not working.
After the mono command ,the command in the next line is the input for the run,so the run process should be running in the background.

---------- Post added 01-17-11 at 02:05 AM ----------

Quote:
Originally Posted by truboy View Post
Thanks for the details !

You should try :

Code:
$ mono --debug /home/sam/axx.exe install &
$ cp file /home/sam/
Or, if mono needs some time before creating file :

Code:
$ mono --debug /home/sam/axx.exe install &
$ sleep 5
$ cp file /home/sam/
After the mono command ,the command in the next line is the input for the run,so the run process should be running in the background.
 
Old 01-17-2011, 05:03 AM   #12
truboy
Member
 
Registered: Oct 2010
Location: Switzerland
Posts: 84

Rep: Reputation: 9
Quote:
Originally Posted by ajeesh.tr View Post
After the mono command ,the command in the next line is the input for the run,so the run process should be running in the background.
If you're using gnome-terminal, try in your script :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install'
$ cp file /home/sam/
Or, if the cp command doesn't execute, run gnome-terminal in background :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install' &
$ cp file /home/sam/
This should open a new terminal window and there you could've the input for Mono. This should work with xterm and konsole as well, just adapt the script with what you're using.
 
Old 01-17-2011, 09:01 AM   #13
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Wink

Quote:
Originally Posted by truboy View Post
If you're using gnome-terminal, try in your script :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install'
$ cp file /home/sam/
Or, if the cp command doesn't execute, run gnome-terminal in background :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install' &
$ cp file /home/sam/
This should open a new terminal window and there you could've the input for Mono. This should work with xterm and konsole as well, just adapt the script with what you're using.
Thank you so much its working fine ,dis was my first thread and got it solved,thanks for the responses from everyone.
 
Old 01-19-2011, 08:32 AM   #14
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by truboy View Post
If you're using gnome-terminal, try in your script :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install'
$ cp file /home/sam/
Or, if the cp command doesn't execute, run gnome-terminal in background :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install' &
$ cp file /home/sam/
This should open a new terminal window and there you could've the input for Mono. This should work with xterm and konsole as well, just adapt the script with what you're using.
Hi,
It is working fine on my desktop but when i tried it on another machine it is throwing an error "Failed to parse arguments:
 
Old 01-19-2011, 08:41 AM   #15
ajeesh.tr
Member
 
Registered: Jan 2011
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by truboy View Post
If you're using gnome-terminal, try in your script :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install'
$ cp file /home/sam/
Or, if the cp command doesn't execute, run gnome-terminal in background :

Code:
$ gnome-terminal -e 'mono --debug /home/sam/axx.exe install' &
$ cp file /home/sam/
This should open a new terminal window and there you could've the input for Mono. This should work with xterm and konsole as well, just adapt the script with what you're using.
Hi,
It is working fine on my desktop but when i tried it on another machine i.e 'gnome-terminal e'it is throwing an error

_IceTransSocketUNIXConnect: Cannot connect to non-local host sam
_IceTransSocketUNIXConnect: Cannot connect to non-local host sam
** (gnome-terminal:17803): WARNING **: Failed to connect to the session manager: Could not open network socket
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
To install firefox extension in command line, How to make commands execute in order sr71919 Linux - General 2 12-28-2009 05:23 PM
how execute a command in a list of commands bkcreddy17 Programming 4 06-24-2009 08:21 AM
How to execute commands within a subshell opened by another command? plin Programming 3 02-11-2008 08:19 AM
Run one script, but execute commands at the same time Micro420 Programming 8 07-18-2007 12:05 AM
Using FTP to execute command line commands remotely steve_2010 Solaris / OpenSolaris 4 02-13-2004 08:44 AM


All times are GMT -5. The time now is 10:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration