Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. time and using linux app

time and using linux app

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
perllinuxquestion
13 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Mon R Santos

    how about sleep(10);

    K Offline
    K Offline
    khomeyni
    wrote on last edited by
    #3

    good but how to use for example oog or totem the app off linux in it?? thanks. valhamdolelah.

    M 1 Reply Last reply
    0
    • K khomeyni

      good but how to use for example oog or totem the app off linux in it?? thanks. valhamdolelah.

      M Offline
      M Offline
      Mon R Santos
      wrote on last edited by
      #4

      if i understand what you want to do... system "oog" == 0 or die $!; sleep(10); system "totem" == 0 or die $!; whatever the syntax for those linux apps are, please fill in.

      K 1 Reply Last reply
      0
      • M Mon R Santos

        if i understand what you want to do... system "oog" == 0 or die $!; sleep(10); system "totem" == 0 or die $!; whatever the syntax for those linux apps are, please fill in.

        K Offline
        K Offline
        khomeyni
        wrote on last edited by
        #5

        thanks i exactly want the thing that you have wrote.but please let me find what is the below error: #!/scr/bin/perl -w #use strict; use warnings; system "oog" == 0 or die $!; sleep(10); system "totem" == 0 or die $!; =pod Argument "oog" isn't numeric in numeric eq (==) at perl.pl line 4. Can't exec "1": No such file or directory at perl.pl line 4. Argument "totem" isn't numeric in numeric eq (==) at perl.pl line 6. Can't exec "1": No such file or directory at perl.pl line 6. =cut __END__ valhamdolelah.

        M 1 Reply Last reply
        0
        • K khomeyni

          thanks i exactly want the thing that you have wrote.but please let me find what is the below error: #!/scr/bin/perl -w #use strict; use warnings; system "oog" == 0 or die $!; sleep(10); system "totem" == 0 or die $!; =pod Argument "oog" isn't numeric in numeric eq (==) at perl.pl line 4. Can't exec "1": No such file or directory at perl.pl line 4. Argument "totem" isn't numeric in numeric eq (==) at perl.pl line 6. Can't exec "1": No such file or directory at perl.pl line 6. =cut __END__ valhamdolelah.

          M Offline
          M Offline
          Mon R Santos
          wrote on last edited by
          #6

          hmmm.... didn't expect that. I wonder which version of Perl that you are using. try this: system("oog") == 0 or die $! etc...

          K 1 Reply Last reply
          0
          • M Mon R Santos

            hmmm.... didn't expect that. I wonder which version of Perl that you are using. try this: system("oog") == 0 or die $! etc...

            K Offline
            K Offline
            khomeyni
            wrote on last edited by
            #7

            thanks for your replies this is my perl version: This is perl, v5.10.0 built for i386-linux-thread-multi i used this command: #!/scr/bin/perl -w use strict; use warnings; #system "oog" == 0 or die $!; sleep(3); my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music"; sleep(8); system "totem --quit $music"; exit; but i want to play a music and then at finish i want to close it but none of the command i write after system "totem --play $music"; are executed until i manually close the totem ,how i can solve this error???? thanks in advance. valhamdolelah.

            R 1 Reply Last reply
            0
            • K khomeyni

              thanks for your replies this is my perl version: This is perl, v5.10.0 built for i386-linux-thread-multi i used this command: #!/scr/bin/perl -w use strict; use warnings; #system "oog" == 0 or die $!; sleep(3); my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music"; sleep(8); system "totem --quit $music"; exit; but i want to play a music and then at finish i want to close it but none of the command i write after system "totem --play $music"; are executed until i manually close the totem ,how i can solve this error???? thanks in advance. valhamdolelah.

              R Offline
              R Offline
              Rob
              wrote on last edited by
              #8

              try using exec "totem --play $music"; iirc, exec does not wait for the command to return output and system does.

              K 1 Reply Last reply
              0
              • R Rob

                try using exec "totem --play $music"; iirc, exec does not wait for the command to return output and system does.

                K Offline
                K Offline
                khomeyni
                wrote on last edited by
                #9

                oh this also not work!! after playing the music it stopped and is on the screen yet. indeed i want to use a linux app and after some works close it with some command as this thing i posted.it can be a music or a program. thanks.

                R 1 Reply Last reply
                0
                • K khomeyni

                  oh this also not work!! after playing the music it stopped and is on the screen yet. indeed i want to use a linux app and after some works close it with some command as this thing i posted.it can be a music or a program. thanks.

                  R Offline
                  R Offline
                  Rob
                  wrote on last edited by
                  #10

                  ok, for clarification... is it still not stopping after 8 seconds? because otherwise all you would need to do is change your second system to exec, because it would be hanging up there.

                  K 1 Reply Last reply
                  0
                  • R Rob

                    ok, for clarification... is it still not stopping after 8 seconds? because otherwise all you would need to do is change your second system to exec, because it would be hanging up there.

                    K Offline
                    K Offline
                    khomeyni
                    wrote on last edited by
                    #11

                    i wrote this : #!/scr/bin/perl -w use strict; use warnings; my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music"; sleep(8); exec "totem --quit $music"; exit; after playing the music in 6 second(time of music) then it stopped until i close it then the command sleep(8) is running and after it terminate my program.i also wrote this code but as above result: #!/scr/bin/perl -w use strict; use warnings; my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music"; exec "totem --quit $music"; exit;

                    R 1 Reply Last reply
                    0
                    • K khomeyni

                      i wrote this : #!/scr/bin/perl -w use strict; use warnings; my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music"; sleep(8); exec "totem --quit $music"; exit; after playing the music in 6 second(time of music) then it stopped until i close it then the command sleep(8) is running and after it terminate my program.i also wrote this code but as above result: #!/scr/bin/perl -w use strict; use warnings; my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music"; exec "totem --quit $music"; exit;

                      R Offline
                      R Offline
                      Rob
                      wrote on last edited by
                      #12

                      ok... so you changed

                      system "totem --quit $music";

                      to

                      exec "totem --quit $music";

                      correct? did you try the change I suggested which was:

                      system "totem --play $music";

                      to

                      exec "totem --play $music";

                      K 1 Reply Last reply
                      0
                      • R Rob

                        ok... so you changed

                        system "totem --quit $music";

                        to

                        exec "totem --quit $music";

                        correct? did you try the change I suggested which was:

                        system "totem --play $music";

                        to

                        exec "totem --play $music";

                        K Offline
                        K Offline
                        khomeyni
                        wrote on last edited by
                        #13

                        yes i also change it to all of states with changing exec to system or system to exec but it play the music repeatedly also this is one of them: #!/scr/bin/perl -w use strict; use warnings; #system "oog" == 0 or die $!; sleep(3); my $music="/home/sajad/intertainment/Music/001.MP3"; system "totem --play $music && totem --quit $music"; #sleep(8); system "totem --quit $music";#exec "totem --quit $music"; exit;

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups