LinuxQuestions.org
Register a domain and help support LQ
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 12-11-2012, 04:33 AM   #1
pls_help_URGENT
Member
 
Registered: Aug 2012
Posts: 42

Rep: Reputation: Disabled
How does $$ execute commands in a .pro file of Qt?


$$system (some_command)

http://rute.2038bug.com/node23.html....00000000000000
Says:
Quote:
$$ Expands to the process ID of the shell.
So, $$ gives the process ID of the shell, then how does it ask the shell to execute the system command?

Is it its internal working that I shouldn't be bothered about? i.e. internally $$ asks the process with the process id to execute the said command?

Last edited by pls_help_URGENT; 12-11-2012 at 05:18 AM.
 
Old 12-11-2012, 05:08 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 1,980

Rep: Reputation: 512Reputation: 512Reputation: 512Reputation: 512Reputation: 512Reputation: 512
$$ is tied to the library function getpid which is called by the current process application (bash).

What is the context of your "$$system(some command)", as bash doesn't have a built in function for system?
 
1 members found this post helpful.
Old 12-11-2012, 05:15 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
$$system (some_command)
Where are you finding this syntax? Can you give an example using a real command?

I think $$ is simply a parameter and does not by itself do anything--see this example:
Code:
[mherring@herring_lap ~]$ echo $$
27876
[mherring@herring_lap ~]$ $$
bash: 27876: command not found
 
Old 12-11-2012, 05:17 AM   #4
pls_help_URGENT
Member
 
Registered: Aug 2012
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
$$ is tied to the library function getpid which is called by the current process application (bash).
Thanks for the information.

Quote:
Originally Posted by jpollard View Post
What is the context of your "$$system(some command)", as bash doesn't have a built in function for system?
Sorry for the confusion.

I was talking about the .pro file of Qt.

I can write:
Code:
 message ($$system (python))
in the .pro file of Qt, and then when I do qmake, python prompt appears.

That's what I was asking about actually.
 
Old 12-11-2012, 07:02 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 1,980

Rep: Reputation: 512Reputation: 512Reputation: 512Reputation: 512Reputation: 512Reputation: 512
Different interpreter. qmake is interpreting the command not bash, so the rules of qmake apply instead.
 
1 members found this post helpful.
  


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
[SOLVED] shell shell to execute commands for pgrep linux833 Programming 11 09-06-2012 11:01 PM
rsync ssh - how to execute shell commands on server banjer Linux - Newbie 4 11-04-2009 02:01 PM
wesite which i can open and execute shell commands online sharma.kashyap Linux - General 1 02-12-2007 10:48 PM
Shell won't execute commands.... frank320 Red Hat 6 03-17-2006 11:12 AM
make c-program that accepts shell commands and execute them boeroe Programming 4 02-18-2005 08:41 AM


All times are GMT -5. The time now is 06:01 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration