Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:54:38+00:00 2026-06-18T07:54:38+00:00

I have an issue when using this command system(konsole –new-tab –workdir<dir here> -e perlprogram.pl

  • 0

I have an issue when using this command

system("konsole --new-tab --workdir<dir here> -e perlprogram.pl &");

It opens perlprogram.pl which has:

system("mpg321 song.mp3");

I want to do this because mpg321 stalls the main perl script. so i thought by opening it in another terminal window it would be ok. But when I do run the first script all it does is open a new tab and do nothing.

Am I using konsole correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:54:39+00:00Added an answer on June 18, 2026 at 7:54 am

    Am I using konsole correctly?

    Likely, no. But that depends. This question can be decomposed into two issues:

    1. How do I achieve concurrency, so that my program doesn’t halt while I execute an external command
    2. How do I use konsole.

    1. Concurrency

    There are multiple ways to do that. Starting with the fork||exec('new-program'), to system 'new-program &', or even open.

    system will invoke the standard shell of your OS, and execute the command you provided. If you provide multiple arguments, no shell escaping is done, and the specified program execed directly. (The exec function has the same interface so far). system returns a number that specifies if the command ran correctly:

    system("my-command", "arg1") == 0
      or die "failed my-command: $?";
    

    See perlfunc -f system for the full info on what this return value signifies…

    The exec never returns if successfull, but morphs your process into executing the new program.

    fork splits your process in two, and executes the child and the process as equal copies. They only differ in the return value of fork: The parent gets the PID of the child; the child gets zero. So the following executes a command asynchronously, and lets your main script execute without further delay.

    my @command = ("mpg321", "song.mp3");
    fork or do {
      # here we are in the child
      local $SIG{CHLD} = 'IGNORE'; # don't pester us with zombies
      # set up environment, especially: silence the child. Skip if program is well-behaved.
      open STDIN, "<", "/dev/null" or die "Can't redirect STDIN";
      open STDOUT, ">", "/dev/null" or die "Can't redirect STDOUT";
      exec {$command[0]} @command;
      # won't ever be executed on success
      die qq[Couldn't execute "@command"];
    };
    

    The above process effectively daemonizes the child (runs without a tty).

    2. konsole

    The command line interface of that program is awful, and it produces errors half the time when I run it with any parameters.

    However, your command (plus a working directory) should actually work. The trailing ampersand isn’t neccessary, as the konsole command returns immediately. Something like

    # because I `say` hello, I can be certain that this actually does something.
    konsole --workdir ~/wherever/ --new-tab -e perl -E 'say "hello"; <>'
    

    works fine for me (opens a new tab, displays “hello”, and closes when I hit enter). The final readline there keeps the tab open until I close it. You can keep the tab open until after the execution of the -e command via --hold. This allows you to see any error messages that would vanish otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this issue: first, I execute a SQL query using Java and then
I've come across this issue in my application, and have reproduced it using Apple's
Note: I'm using Google Chrome Currently I have this test page http://www.evecakes.com/doodles/canvas_size_issue.htm It should
I have been using this code, but have been running into some memory issues:
I have an issue using jquerys selectors when it comes to a page I
I have an issue using xsd dataTime with regard to integrating a web client
I have an issue with using the following code in my CakePHP app. In
I have an odd issue while using FlashCS4. I have a textfield that, when
First of all: I'm at Scala 2.8 I have a slight issue while using
i have an issue with synchronizing Master/slaves processes using MPI. I wish that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.