User Profile

Collapse

Profile Sidebar

Collapse
KiSSFRo
KiSSFRo
Last Activity: Dec 5 '08, 06:43 PM
Joined: Sep 24 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • KiSSFRo
    started a topic Unix command, hide error message
    in Perl

    Unix command, hide error message

    Hi all,

    I was wondering if someone could tell me which is the best command to use to run a unix command and to hide the error output from the shell. I'd also like to be able to tell if the command failed or not. What would be the best to use: backticks, system or exec?

    BTW I also cross posted this over here: Perl Guru Forums: Perl Programming Help: Beginner: Unix command, hide error message


    ...
    See more | Go to post

  • KiSSFRo
    replied to Program Performance
    in Perl
    Thanks Kevin. I guess what initially lead me to think that I could improve the efficiency is whenever Im at the console and I do a grep it finds the information so quickly, even for big files. I guess if ran through the Perl interpreter this would be a lot slower?
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    replied to Program Performance
    in Perl
    I'm going to paste my code and I was wondering if any of you guys can see where I can be more efficient. I know a lot of it is sloppy because I'm a Perl beginner and I went quickly through this. Any feedback would be much appreciated. Here is my code:

    Code:
    #!/usr/bin/perl -w
    use Cwd;
    use Time::Local;
    
    main();
    
    sub partition
    {
    	my $x = $testNames[$_[0]];
     	my $i = $_[0]
    ...
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    replied to Program Performance
    in Perl
    I come across a line in the file, then I go search my sorted list of elements to see if it matches one of them.

    KiSsZ...
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    replied to Program Performance
    in Perl
    I have a list of items that I'm searching for in the big files and they are stored in an array and they are sorted. A binary search is when you first look at the middle value to compare with the value you're looking for, then if it's less you go to middle value of the left half of the array, if it's greater you go to the middle value of the right half of the array and you keep doing this till you find the value. With each comparison you eliminate...
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    started a topic Program Performance
    in Perl

    Program Performance

    Hi,

    I have a program that does the following: given a directory as it's only argument, it goes to that directory and looks for directories inside that contain 2 special types of very large files. If it finds these files, it goes through each file line by line looking to see if they contain certain strings. As mentioned, these two files are very big and contain a lot of information, and I recently ran this program on a certain directory...
    See more | Go to post

  • KiSSFRo
    replied to `du -sk $dir1/$file1` produces error
    in Perl
    Sorry forgot to answer your question Jeff. I'm using F-secure SSH Client to log onto a linux machine.

    KiSS
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    replied to `du -sk $dir1/$file1` produces error
    in Perl
    I tried both of those, still no dice. Thanks for trying to help though. This is driving me nuts, the program works, I just want those ugly errors to go away.

    KiSS...
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    replied to `du -sk $dir1/$file1` produces error
    in Perl
    I tried that and the $out populated as it was supposed to. Also tried inserting $dir instead of $dir1/$file1 in the split line but the error message still shows. This is so weird.

    KiSS
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    replied to `du -sk $dir1/$file1` produces error
    in Perl
    Hi,

    I tried doing:

    Code:
    @temp = split(/\s+/, `du \–sk $dir1/$file1`);
    and it still acted the same way. Thanks for trying though.

    KiSSa
    See more | Go to post

    Leave a comment:


  • KiSSFRo
    started a topic `du -sk $dir1/$file1` produces error
    in Perl

    `du -sk $dir1/$file1` produces error

    Hi all,

    I'm having a problem with the following piece of code in one of my programs:

    Code:
     @temp = split(/\s+/, `du –sk $dir1/$file1`);
    push(@directorySizes, $temp[0]);
    I'm getting the following error for each time the first line is called: "du: cannot access `\226sk': No such file or directory." Everything is working as it's supposed to, I'm getting the correct value for du -sk $dir1/$file1...
    See more | Go to post
No activity results to display
Show More
Working...