Shell script may slow down terminal opening

script
Here is a piece of script on wiki,
alias archnews="echo -e \"$(echo $(curl --silent http://www.archlinux.org/feeds/news/ | sed -e ':a;N;$!ba;s/\n/ /g') | sed -e 's/&lt;\/a&gt;/@/g' | sed -e 's/<title>/\\n\\n\\n\\t:: \\e[01;31m/g' -e 's/<\/title>/\\e[00m ::\\n/g' | sed -e 's/<link>/ [ \\e[01;36m/g' -e 's/<\/link>/\\e[00m ]/g' | sed -e 's/<description>/\\n\\n\\e[00;37m/g' -e 's/<\/description>/\\e[00m\\n\\n/g' | sed -e 's/&lt;p&gt;/\n/g' | sed -e 's/&lt;a href\=\"\([^\"]*\)\"&gt;\([^@]*\)@/\\e[01;32m\2\\e[00;37m \\e[01;34m[ \\e[01;35m\1\\e[00;37m\\e[01;34m ]\\e[00;37m/g' | sed -e 's/&lt;li&gt;/\n \\e[01;34m*\\e[00;37m /g' | sed -e 's/<[^>]*>/ /g' | sed -e 's/&lt;.*&gt;//g')\n\n\""
I found it would slow down the terminal from opening under slow network connection (or without network).
It take  about 1 second to open a new terminal with it in .bashrc.
Forgive my English.
Last edited by sillyousu (2012-09-10 14:23:40)

Take this command as an example:
$ alias thetime="echo $(date)"
$ thetime
Mon Sep 10 12:54:38 CEST 2012
$ sleep 10
$ thetime
Mon Sep 10 12:54:38 CEST 2012
The $() command in double quotes is launched once at shell start up. If news comes while the shell stays open, this alias won't actually fetch the news.

Similar Messages

  • Outlook 2010 - User tends to open many emails at a go but this may slow down the machine.

    Hi,
    My user tends to have this work habit of opening 8-10 emails at one go. She view this way of working as more efficient and faster. But this means that if outlook crashed, all the emails will be close as well, and this way of working tends to slow down the
    machine.
    Is there any way Outlook can users to open multiple emails without hording CPU page milage?
    Thank you.

    Hi Josh,
    Slow Outlook can be also harmful for your database and there are numbers of factor which slow down the MS-Outlook like:
    * Third Party Plug-ins
    * Slow internet connection
    * Antivirus/ Firewall Programs
    * Corruption or Error within Outlook
    So always try to open Microsoft Outlook in safe mode whenever you stuck in such problems. 
    How to optimize Outlook performance:
    * By Disabling add-ins
    * Check default account settings
    * Disabling Scanning programs
    * Scanpst.exe (Inbox Repair Tool)
    For more brief about Outlook disturbance and solutions:
    http://support.microsoft.com/kb/813514
    Note: Improve community discussions by marking the answers helpful.
    Thanks
    Clark Kent

  • Bash script to slow down cpu for old game

    hi, I'm trying to play some old windows game via wine, with default cpu frequency the game is to fast, If i set frequency around 1GHz game acts as it should, so I want to make desktop shortcut to automate process and I doesn't really know how to write script that will set lower cpu frequency and launch the game and after quiting the game it will reset the cpu policy.... any help is appreciate
    sorry for my english

    A quick tutorial on setting CPU frequency:
    Any commands starting with $ can be run by any user, ones starting with a # must be done as root
    To check your current governor:
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    To change your governor to allow manual frequency setting:
    # echo "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    To check your current frequency:
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    To check what frequency your processor allows:
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    To set a frequency:
    # echo "1000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    of course, replace 1000 with the frequency you want!
    To restore your previous governor:
    # echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    of course, replace ondemand with the governor you were originally running!
    There is no need to restore the original frequency, the governor will take care of that.
    If you're using cpufrequtils, on the other hand, it will interfere with the above and you'll have to disable it first
    # /etc/rc.d/cpufreq stop
    Then when done, re-enable it again
    # /etc/rc.d/cpufreq start
    A sample shell script without cpufrequtils:
    #!/bin/sh
    echo "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    echo "1000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    su -c "[i]command to launch your game[/i]" [i]username[/i]
    echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    A sample shell script with cpufrequtils:
    #!/bin/sh
    /etc/rc.d/cpufreq stop
    echo "1000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    su -c "[i]command to launch your game[/i]" [i]username[/i]
    /etc/rc.d/cpufreq start
    Both need to be run as root.
    Warning 1: I haven't had the chance to test either script, but in principle they should work.
    Warning 2: Both scripts assume your game doesn't disconnect itself from the terminal.  If it does, you'll need to split the scripts into two (one to slow down the cpu, another to speed it up).
    If the above works for you, it is possible to make it more convenient using sudo.

  • 19 working fine, downloaded 20 - it crashes frequently, hogs memory, runs scripts and slows down internet. I don't want a fix, just reinstall 19

    FF 19 was working fine. Downloaded 20 and within 5 mins. it crashed. Script running problems again and it slows down my internet connection tremendously. I don't want to fix it, I want to go back to FF 19 but can't find it - it doesn't exist Running XP SP 3. If I can't go back to FF 19, then I'll just remove it and stick with Chrome. I like the old private browser in FF 19 better. I run 20 - 40 tabs open at a time and the way the new Private browser works with the existing window open just uses more memory Thanks!

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Firefox slows down when opening a site with animated gifs

    After updating to FF4, I find that whenever I try to open a page that has multiple animated gifs on it, firefox slows down tremendously. CPU usage goes up to 50-75% and all animated gifs are moving really slow.
    It's not only large animated gifs, but it also occurs on forums that have animated smilies. I never had this problem in FF 3.6 nor any other browser (IE, Chrome, Safari). If I start FF4.0 without any add-ons or plugins it does the same thing. Even with a fresh install. Does anyone have a solution to his problem? Since I can't use some of my favorite sites now with FF, without my pc slowing everything down.

    Disabling the hardware acceleration worked for me!

  • Preflight check in CS5 dramatically slows down file opening

    The preflight check option in InDesign does not seem to run in the background. As a result, it now takes around 5 times longer to open a file, as you have to wait for the preflight check to finish before you can do anything. Sure you can turn it off, but that kind of defeats the point of having it. Is there any way to configure it so that it runs in the background, or is this just another feature that is basically rendered unusable?

    What I am seeing is this: I open an InDesign file. The spread appears and all the objects placed on that layout appear, just as usual. Then I get the spinning beachball, which coincides with the preflight checking the file (you can see the word "checking" in the bottom left of the frame). The beachball stops and I can finally access the file once the preflight chack is complete. So, on that basis, it doesn't seem to be running in the background. Turning preflight off eliminates the problem. So yes, the file is open and visible, but I can't get at it until the preflight check is complete.
    For reference, I am using OS 10.6.6 and InDesign 7.0.4.550.
    Note that using the Basic preflight check, I don't get these problems, but using a custom profile, I do. I started trying to see if I could pinpoint what in the extra checks was causing the problem, but I failed: I took the basic profile, which works fine, and added the first extra check from my custom profile, which is to Check OPI Links in LINKS. I immediately got the slow down. But unchecking that in my custom profile, didn't speed things up, which suggests that it's more than one thing. If it helps, my custom profile is cheking for:
    LINKS
    Links missing or modfied
    Inaccessible URLs
    OPI Links
    COLOUR
    Transparency blending space
    Colour spaces not alowed
    Overprinting applied to white
    Registration applied
    IMAGES & OBJECTS
    Image resolution
    Interactive elements
    TEXT
    Overset text
    Font missing
    Glyph mising
    Font types not allowed
    DOCUMENT
    Bleed & slug setup

  • TCP681K slows down terminal server through BM 3.8 sp5

    HI
    Updated to TCP IP patch TCP681K and now connecting to the terminal server via the internet is slower. If I am on the inside of the firewall and connect to the inside address it works great. If I am on inside and connect to the outside address its slow. Are there any settings I can tweak?
    Thanks,
    Will

    Hi,
    nwconsult wrote:
    >
    > HI
    >
    > Updated to TCP IP patch TCP681K and now connecting to the terminal
    > server via the internet is slower.
    And you connect to the terminal server how exactly? I can come up with
    about half a dozen totally different methods how to connect "via the
    internet" to a terminalserver, involving a BM.
    CU,
    Massimo Rosen
    Novell Product Support Forum Sysop
    No emails please!
    http://www.cfc-it.de

  • A "Script" is slowing down my computer. I keep stopping it, but it keeps coming back. I cannot update my browser, because I am running a MAC 10.4.11 (tiger) operating system.

    I keep getting a message that a "script" is running on my computer. I am given the option of discontinuing it--which I do. It works briefly, then the "script" comes back, I get the message again, choose to discontinue it, etc. I cannot upgrade my browser, because I have the MAC OS 10.4.11 (tiger). I don't know what to do. Do you have any advice? Thanks, and have a wonderful day. Jane

    It's from Apple (Mac OS X Leopard Upgrade DVD). I have never gone to an outside source for repair or software (outside of Microsoft Office which is no longer on my computer since I have had these issues).  This is the first time I have required help since my Apple Care ran out. 

  • How can i pass parameter values from html to a shell script

    Hi Guys...
    I had a requirement where i need to execute a sql statement and print the output in HTML page. This report has parameters to enter. So i created a HTML form which accepts parameters. When the submit button is pressed, the action tag in the form invokes unix shell script file. It will open sqlplus and run the sql script file .sql and print the output in the HTML page.
    sql script contains the query and some set options which prints the output in HTML page. Like "SET MARKUP HTML ON"... The query has some parameters like "select * from emp where empno = &&empnumber. I will use the same name "empnumber" while created the HTML parameter form like " <input type = "text" name="empnumber" size="10" align="left">.
    user sees this parameter form and enters some value in to that empno text box.
    My question is how can i catch these parameter values in a shell script and pass it to the sql script to execute it.
    Help Appreciated
    Thanx

    This is a A Bad Idea (tm). This type of CGI processing is old and were (and still is) full of security holes. Very easy to inject stuff (Unix commands and SQL) into it.. To get those parameters into SQL*Plus requires using Unix shell commands to process it - and something like a backquote allows all kinds of nasty stuff to be injected. The Unix shell was never designed to be used as a secure CGI environment.
    There are far better and far superior alternatives. Perl (with Perl_DBI) and PHP (using Zend Core for Oracle) come to mind as web scripting languages.
    Even easier is using HTMLDB. Very few moving parts. Is free. Supports Oracle 9.2 and 10G.

  • How to get return code or parameters from PL/SQL in my shell script ?

    My shell script must check the result of PL/SQL's running, and decide what to do in the next step.

    I think you put the problem the wrong way.
    You should try to do as much as possible through your SQL scripts, and, if you need to make OS calls, you may do that using host(command_string).
    If you need to transfer parameters from other programs to your FORMS (PL/SQL), then you have to see user_exit.
    Some other means would be to have your PL/SQL write to certain OS files that the shell script may read, but that doesn't seem like good practice to me.

  • Echo colored text in a shell script?

    As part of a shell script I'm working on, I want to be able to print colored (preferably red) text to the Terminal window, to provide warnings to the user.
    How can I code in echoing colored text?
    (I did some googling and couldn't find anything that seemed to apply to what I want to do.)
    Any help would be appreciated!
    Thanks in advance!

    The following is a shell script that displays the terminal colors and the escape sequences used to generate them:
    #!/bin/sh
    # colors.esc - display the terminal colors and the escape sequences that
    # generate them. "Blink" is _NOT_ shown, as it is a very
    # annoying effect, and should be avoided at all costs in normal
    # daily uses.
    # Usage: colors.esc [12 character or less display string]
    # Bob Harris
    E=$(printf ' ') # escape <E>
    R="${E}[0m" # reset <E>[0m
    typeset dsp_str=""
    typeset dsp_txt
    typeset fg_text
    typeset bg_text
    if [[ $# != 0 ]]; then
    dsp_str=$(printf "%12.12s" "$*")
    fi
    color=(Black Red Green Yellow Blue Magenta Cyan White)
    for bg in "" 0 1 2 3 4 5 6 7 # for each background color
    do
    b=$bg && [[ X$b != X ]] && b="4$b;" # deal with no background color ""
    echo " ------------ ----bold---- -underline-- --reverse---"
    for fg in 0 1 2 3 4 5 6 7 # for each foreground color
    do
    f="3$fg" # setup foreground color
    line=""
    for a in "" 1 4 7 # for each attribute
    do
    [[ X$a != X ]] && a=";$a" # deal with no attribute ""
    if [[ -z "$dsp_str" ]]; then
    dsp_txt=$(printf "%12s" "<E>[${b}${f}${a}m") # build esc text
    else
    dsp_txt="$dsp_str" # use supplied text
    fi
    line="${line}${E}[${b}${f}${a}m${dsp_txt}${R} " # build entry
    done
    fg_text=$(printf "%-7s" ${color[$fg]}) # translate foreground color
    bg_text=$(printf "%-9s" "Bg${color[$bg]}") # translate background color
    [[ X$b = X ]] && bg_text=$(printf "%-9s" " ") # no bckgnd color
    line="$bg_text $fg_text $line" # build final display line
    echo "${line% }" # display the colorized line
    done
    done
    echo " ------------ ----bold---- -underline-- --reverse---"
    bg_text=$(printf "%-9s" " ")
    fg_text=$(printf "%-7s" "Reset")
    dsp_txt=$(printf "%12s" "<E>[0m")
    line="$bg_text $fg_text $dsp_txt" # build final display line
    echo "${line% }"

  • IBook slowing down (or so it seems...)

    Hi Everyone,
    I have had my iBook for just over a year, and recently I have been experiencing some slow down in opening documents, Camino, Word, Excel and other apps. I normally have 1 or 2 (or up to 4) apps open, but recently I will have 2 apps "Not Responding" and I have been getting the Beachball much more often than I have in the past. Any ideas/remedies or solution would be welcome.
    Best Regards,
    Michael Barney

    When I have Activity Monitor, iTunes and Camino it would vary from 6% usage to 51%. Then when I would connect to a webiste or a song would change it would spike up. My ram would vary from around 75 to 85 MB of my 512 free.
    I think I am getting frustrated with my school's crappy internet and I am not sure if that has something to do with it.
    I was having problems connecting to these discussion boards. Then I quit out of Camino and I reloaded it all and it worked...
    I think my computer is possesed.
    Michael

  • Strange slow down

    ok, so i'm trying to wrap my head around how this happened. i opened fcp and it loaded all my open projects at a normal speed.
    than i quit fcp and had to do a file transfer. i've two macs hooked up via ethernet and started transferring files. none of these files are in any of my fcp projects.
    i opened up fcp during the file transfer, and it took like ten minutes to load just 1 project. it was massively, ridiculously slow. so i quit fcp, stopped the ethernet transfer, reopened fcp and it loaded at normal speed.
    how and why did the ethernet transfer slow down the opening of fcp?

    Not only that, but FCP on startup scans mounted drives for footage/renders. If your remote drive is mounted FCP will wander off looking there. This is exasperated by the bandwidth occupied by the copy in progress...
    Patrick

  • Will having another OS on partition slow down my computer?

    I have an early 2013 iMac (base 8gig RAMs, 1 TB harddrive, 2.7 GHz) that came with Mountain Lion. I want to partition my harddrive to install Mavericks. Will this slow down my computer's performace in any way? Also, if I keep going back and forth between Mountain Lion and Mavericks, will it harm the computer? Thanks in advance.

    It may slow down your system slightly, depending on how full it is.  With a spinning hard drive, it's the fastest at the outside, which is where the Mountain Lion partition is.  So the Mavericks partition will be slower, but it may only be 10% to 15% slower for disk-related activities (assuming the disk isn't all that full).
    But you also need to decide how you're going to handle your data: If you have a home directory on each partition it's going to be a pain.  However if you DON'T (and attempt to share it), then applications that update their database (i.e. Mail, Notes, etc.,) may have data loss or otherwise corrupt things.  So that's a risk.
    Any reason you want to partition the drive?  For the vast majority of users, Mountain Lion to Mavericks is a smooth upgrade.  My recommendation would be to have a FULL backup (Time Machine, AND make a clone with SuperDuper! or Carbon Copy Cloner to an external drive).  Then just upgrade.  On the off chance that things do go terribly, you can just clone your drive back. 

  • Problem with running Bash shell scripts

    I am unable to run Bash shell scripts on the UNIX Terminal application.
    This is the transcript from the Terminal application.
    Zhi-Yang-Ongs-Computer:/Applications/MetaPost/metapost-1.102 zhiyangong$ ./test1.sh
    dyld: Symbol not found: _BC
    Referenced from: /usr/local/bin/bash
    Expected in: /usr/lib/libSystem.B.dylib
    Trace/BPT trap
    Zhi-Yang-Ongs-Computer:/Applications/MetaPost/metapost-1.102 zhiyangong$
    Is this a problem with the the default installation of the Bash shell? Can I install the Bash shell on my own? If so, how can I do that?
    Also, how can I get the dynamic linker, dyld, to refer to the symbol "_BC"? What does this symbol "_BC" refer to?

    This was in your posted output:
    /usr/local/bin/bash
    You are NOT running the default bash, you are trying to run a private copy.
    The default Mac OS X bash is located at
    /bin/bash
    Try the following:
    /bin/bash ./test1.sh
    Does that work?
    What is the first line of your script? Is it:
    #!/bin/bash
    Or maybe
    #!/usr/bin/env bash
    /usr/bin/env would find the first bash in PATH . I find this most useful for finding perl on different systems, but sh, ksh, bash, zsh, csh, tcsh are all generally found in /bin so I do not bother using /usr/bin/env
    And if you have
    #!/usr/local/bin/bash
    Then the person that wrote test1.sh choose to use something besides the default bash
    Or maybe this script was transferred from some system where you needed to put your own copy of bash in /usr/local/bin because the vendor does not distribute bash
    Then again, you have not showed us what is inside your script, so it is possible something in the script called something else which invoked the /usr/local/bin/bash
    If that is the case, then you might try:
    /bin/bash -x ./test1.sh
    which should show you the commands executed before it died.

Maybe you are looking for

  • Switching accounts

    Hi Brenda, How are you? You may remember me based on the email correspondence below as you helped me move my late Husbands Apple account over the my account. I was hoping you could help me again with a similar issue as my iPad is also linked to Fabia

  • Is there a way to have search box items open in a new tab?

    is there a way to have Safari open searches (from the search box next to the address bar) in a new tab, rather than overwriting the existing one? I'm guessing the answer to this is "not until someone makes an extension...", but thought I'd ask...

  • How do i get rid of the word 'site' in the my website address

    Hello, My website is www.giftedconsultants.com, done in iweb, hosted by little oak. After I publish and then go to the site, each page comes us like this-www.giftedconsultants.com/site/Home.html. My question is how do I get rid of the word 'site'? Wh

  • Strange disappearance of WiFi abilitiy for iPhone 3GS?

    Over the last few weeks my wifi capability has seriously decreased. I use the latest BT Home Hub and ALL other wifi devices are working. It is clear that the problem is range-related as when I sit next to the hub, the wifi works well; however, when i

  • Default selection on current month, week and date

    Hi, We are on Dashboard 4.1 sp3 the same version as BI. The dashboard report is using LiveOffice connection. We are now facing an issue with default selection on current month, week and date. The dashboard report drilled down from month, to week, the