Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I've got strange problem: After added command perl do_sth_ob_bg.pl & to my .bashrc (yes, using bash), scp to that machine stops to work, it connects and hangs. After a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! srerucha's Avatar
    Join Date
    Jun 2005
    Location
    Brno, Czech republic
    Posts
    58

    SCP hangs with commands in .bashrc


    Hi,
    I've got strange problem:

    After added command

    perl do_sth_ob_bg.pl &

    to my .bashrc (yes, using bash), scp to that machine stops to work, it connects and hangs. After a while, it's dropped with timeout.

    Anyone could explain it ? Any suggestion to work-around ?

    Thanx a lot, merry xmas ))

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    perl do_sth_ob_bg.pl &
    Well, what does this do exactly?

  3. #3
    Just Joined! srerucha's Avatar
    Join Date
    Jun 2005
    Location
    Brno, Czech republic
    Posts
    58
    Quote Originally Posted by anomie
    Well, what does this do exactly?
    Here is it .. it displays machine load in xterm title bar. Guess that may cause the problems for scp....

    srerucha@box:~> cat ~/bin/load.pl
    #!/usr/bin/perl -w

    use strict;
    $|++;

    my $host=`/bin/hostname`;
    chomp $host;

    while(1) {

    open(LOAD,"/proc/loadavg") || die "Couldn't open /proc/loadavg: $!\n";

    my @load=split(/ /,<LOAD>);
    close(LOAD);

    print "\033]0;";
    print "$host: $load[0] $load[1] $load[2] at ", scalar(localtime);
    print "\007";

    sleep 2;
    }

  4. #4
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    I wonder if you could add that to a more appropriate place. Rather than the ~/.bashrc file, how about adding the entry to some place related to X?

    Are you using KDE? If so, add it to ~/.kde/Autostart. If not, which desktop environment are you using?

    If nothing is available within your desktop environment for this purpose, you could add the entry to the ~/.xinitrc file.

  5. #5
    Just Joined!
    Join Date
    Nov 2005
    Posts
    20
    I had the same problem. If bashrc contains any echo or similar commands, scp tries t parse the messages and gets confused.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •