Bash question

With this bash security flaw that came out recently, I wanted to make sure my thinking is correct on this. I have two Web Site that I run on AVDOM and I do my setup and testing on my macbook pro using MAMP. Both of my sites run on Wordpress. I only run MAMP when I am running tests on or updates on the Web site otherwise it's not running. I assume that I should not have any security problems with Bash since I am only running it at limited times but I wanted to get another opinion on that. I am not sure how bash affects MAMP other than it runs the Apache Server, PHP server, and SQL server. 
Thanks,
Patrick

Apple has promised an update for advanced Unix users (the only ones possibly affected are those running OS 10.9.5):
http://www.imore.com/apple-working-quickly-protect-os-x-against-shellshock-explo it
Advanced users who have OS X machines in a situation where they may be remotely exploited, such as systems administrators with internet-facing OS X servers, can mitigate the issue by recompiling bash with the official patches from GNU until Apple issues its own update:
https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052

Similar Messages

  • [SOLVED] alias or bash question

    Hello all,
    I just need a liittle help on alias or bash
    Right now, I want to run vim on xterm. So I always invoke
    xterm vim
    Everything works fine but when I manually add a directory or a directory of a file, something like
    xterm vim /directory/of/file_here
    It won't work.
    This is like manually opening a file in gvim or any app.
    I just want vim to run on xterm.  This is like clicking a file and open with gvim ('xterm vim' in this case).
    I'm currently using KDEmod4.2
    Last edited by ragingmon (2009-02-22 11:08:21)

    yay!! thanks a lot droog!!!
    that was really fast.
    marked as solved..

  • Quick Bash Question

    I'm trying to write a simple bash script which downloads the compat-wireless drivers and installs them. The script works fine but i'm trying to learn bash and would like to make it a bit nicer to look at and add some more functionality. What I have done is used grep to pull out the percentage of the download, however every number prints on a new line like so:
    1%
    2%
    3%
    4%
    5%
    6%
    etc.... What I'm trying to do is replace the last percentage with the next one, so it's all on one line. I've had a look around and found that a way to do what I'm trying to do is with:
    tput cbt
    or with the bash escape codes directly. Now the thing is I don't know where I should put this in my code, could anyone help?
    #!/bin/bash
    #Retrieve latest compat-wireless soruces
    echo -e "Downloading sources\n"
    wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 |& grep -o "[0-9]\+%"
    if test -fs compat-wireless-2.6.tar.bz2 then
    echo "File Downloaded OK"
    else
    echo "Download Failed, Exiting."
    exit
    fi
    #Untar folder
    echo "Extracting sources"
    tar jxvf compat-wireless-2.6.tar.bz2 > /dev/null
    #Enter build folder
    cd compat-wireless-*
    #Select ath9k as driver to build
    ./scripts/driver-select ath9k
    #Compile sources
    make
    #Install sources
    sudo make install
    #Unload wireless modules
    sudo make unload wireless
    #Reload ath9k module
    sudo modprobe ath9k
    #Return to original directory
    cd ..
    #Remove traces of install files
    sudo rm -r compat-wireless-*

    Ok, so I've tried
    #Retrieve latest compat-wireless soruces
    echo -e "Downloading sources\n"
    wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 |& printf "\r `grep -o "\r[0-9]\+%"`"
    To no avail, am I doing this correctly, or at least on the right lines? I can't seem to find any examples where a command is used within a printf statement.
    Thansk for the help so far!
    edit: Just a thought, could I possibly encompass the grep command into a variable and then pipe it into a printf statement?
    Last edited by jack.mitchell (2011-01-18 15:50:19)

  • [Solved] Quick Bash Question

    Ok, I have a loop and I want to count the number of times the loop occurs in my script. Every time the loop occurs there is an output. I want during the loop to display 1 - infinite number until the loop stops.
    Do you know what I am getting at?
    Last edited by haxit (2009-02-13 18:04:37)

    Ok, so I have this script:
    #!/bin/bash
    if [ -z "$1" ]; then
    echo "Please run like so: 'sh "$0" <highest number on dice>'"
    else
    WOW=`echo "$1*2" | bc`
    for X in 1 2 3; do
    ONE=`seq 1 $1 | sort -R | head -1`
    TWO=`seq 1 $1 | sort -R | head -1`
    HAH=`echo "$ONE+$TWO" | bc`
    until [ $HAH -eq $WOW ]; do
    ONE=`seq 1 $1 | sort -R | head -1`
    TWO=`seq 1 $1 | sort -R | head -1`
    HAH=`echo "$ONE+$TWO" | bc`
    NUM=`echo "1"`
    echo "$HAH" >> probability.log
    done
    LOL=`cat probability.log | wc -l`
    echo "$LOL"
    rm probability.log
    done
    fi
    It gives me three outputs, I want to add those outputs and divide them by 3.

  • Dumb bash question

    I'm doing a develop work and need to quickly change from one folder to another. So i created a simple script
    cd /folder1/folder1-sub1/folder1-sub2/
    save it as 'docdir', and chmod 755 docdir
    then
    ./docdir
    nothing happens
    What I expect to happen is to change from login folder to new /folder1/folder1-sub1/folder1-sub2/ but no change?????? also no error??
    thanks Mike

    Sorry but I find my mistake amusing. It worked but I didn't know what I was telling it to do.
    So If I understand you correctly what I did was move the scripts shell from one directory to another. So to continue on that thought one could write a script that way (alright it probably wouldn't make sense to do that, but you could)
    To see if I understand the difference, these totally arbitrary examples
    call bash shell,
    cd /var
    cat filenames | grep march > /tmp/changes.txt
    cd /var/apache
    cat filenames | grep march > /tmp/changes.txt
    cd /tmp
    grep -i am changes.txt > morningchanges.txt
    Where we normally would do this by calling those files with the folder location
    cat /var/filenames | grep march > /tmp/changes.txt
    cat var/apache/filenamesdiferentfolder | grep march > /tmp changes.txt
    grep -i am changes.txt > morningchanges.txt
    well let me know if I understood it.

  • [SOLVED] Quick bash question (~/.bashrc stuff)

    Hi!
    First I have to say that I have installed Arch few days ago and it's pretty sweet stuff -- but I guess you already have heard that oh-so-many-times!
    So there is it, I would like to change my prompt's color everytime <enter> is pressed in the terminal (well, everytime a new prompt is shown).
    But so far I was only able to change my prompt's color everytime a new terminal is opened, with this code in .bashrc :
    # color changing for the prompt
    colors=("\[\e[0;30m\]" "\[\e[0;34m\]" "\[\e[0;32m\]" "\[\e[0;36m\]" "\[\e[0;31m\]" "\[\e[0;35m\]" "\[\e[0;33m\]" "\[\e[0;37m\]" "\[\e[1;30m\]" "\[\e[1;34m\]" "\[\e[1;32m\]" "\[\e[1;36m\]" "\[\e[1;31m\]" "\[\e[1;35m\]" "\[\e[1;32m\]" "\[\e[1;37m\]")
    let R=$RANDOM%16+0
    color=${colors[$R]}
    prompt="${color}\u@\h:\w\$\[\e[0m\] "
    # the prompt
    PS1=$prompt
    Thanks.
    Last edited by orph (2009-03-01 16:10:57)

    You could use the PROMPT_COMMAND:
    colors=("\[\e[0;30m\]" "\[\e[0;34m\]" "\[\e[0;32m\]" "\[\e[0;36m\]" "\[\e[0;31m\]" "\[\e[0;35m\]" "\[\e[0;33m\]" "\[\e[0;37m\]" "\[\e[1;30m\]" "\[\e[1;34m\]" "\[\e[1;32m\]" "\[\e[1;36m\]" "\[\e[1;31m\]" "\[\e[1;35m\]" "\[\e[1;32m\]" "\[\e[1;37m\]")
    PROMPT_COMMAND='let R=$RANDOM%16+0;color=${colors[$R]};PS1="${color}\u@\h:\w\$\[\e[0m\] "'

  • Simple bash question: how to script into new shell?

    I want to have a script that opens a new terminal and calls some commands. I am to stupid. :oops:

    Pink Chick wrote:
    *Smack*
    This should be ok. I was tired of typing "makepkg foobar", and so I wrote a tiny dirty nautilus script to do that for me. Unfortunately, it worked in the background. Not bad, if you KNOW your package is ok, but in case of errors.
    Thank you all. 
    hmm sounds like an interesting idea... i don't use nautilus myself... but i could see it being cool to double click a PKGBUILD file and have it run makepkg...

  • Another Bash question.

    Hey! I'm in the middle of writing a admin script witch can handle users and groups etc. My problem is this:
    echo ""
    echo "Please select a username for the new account: "
    read username
    echo "And now the password: "
    stty_orig=`stty -g`
    stty -echo
    read password
    stty $stty_orig
    grepit='grep -o -m 1 ^$username /etc/passwd'
    $grepit
    if
    [ "$grepit" = "$username" ]; then
    echo "This username already exist, please try again"
    This part doesn't work at all, maybe its me that is a retard but in my opinion and based on my knowledge it should work, but it doesn't. Any ideas?

    Hmm i'm not really good at this but i am willing to learn so here comes the whole code instead so you can explain a little more because i've tested your suggestions and it isn't working any better
    select opt in $OPTIONS; do
    if [ "$opt" = "Add-user" ]; then
    echo ""
    echo "Please select a username for the new account: "
    read username
    echo "And now the password: "
    stty_orig=`stty -g`
    stty -echo
    read password
    stty $stty_orig
    $grepit=(grep -o -m 1 ^$username /etc/passwd)
    fi
    if
    [ "$grepit" = "$username" ]; then
    echo "This username already exist, please try again"
    else
    echo "Select a primary group for the account (the group must exist): "
    read group
    echo "Are you sure you want to add this user? (y/n)"
    read yorn
    fi
    if [ "$yorn" = "y" ]; then
    useradd -g $group -p $password $username
    echo "$username added with the primary group $group."
    echo ""
    fi

  • [SOLVED] Stupid bash question (cp command)

    I accidentally copied a file using * as the destination, like this:
    cp /path/to/file *
    There was no error so it must have done something but I can't figure out what.
    Can anyone tell me what that command does, thanks.
    Last edited by r6 (2010-08-31 07:15:29)

    Hehe getting used to the terminal in the beginning can be fun, you are bound to make some mistakes - I still do at times
    In the mean time adding these to your .bashrc could be helpful safer:
    alias mv="mv -i"
    alias cp="cp -i"
    alias rm="rm -i"

  • Newbie bash question

    Hi,
    I'm trying to make an alias for a function to kill whatever program is accessing my DVD drive, because sometimes vlc (or sthg else) will shut down in a dirty way and prevent me from ejecting the drive.
    When I run:
    lsof -t /dev/sr1|xargs kill -9
    from the command line, it works.
    But if I put:
    alias fcd="lsof -t /dev/sr1|xargs kill -9"
    in .bashrc and invoke fcd, I get an error.
    Do you know what the problem might be?

    As I was trying to reproduce the problem so I could post the exact output, I noticed that while VLC was playing the DVD, lsof /dev/sr0 returned nothing. this seems weird (and I wasn't running vlc as root...). It could explain my problem because then there would be no process to kill.
    @kludge: thanks, indeed it's more simple using: fuser -k /dev/sr0
    While I'm at it, I tried earlier to make an alias to kill firefox using the long way (before I learnt about killall):
    ps -e|grep firefox|awk {'print $1'}|xargs kill -9
    And this works but if I make it an alias, there seems to be a problem with the text delimiter:
    alias kfx="ps -e|grep firefox|awk {'print $1'}|xargs kill -9" does not work and I think it's because the ' and the " get mixed up. Is there a way to sort this out?

  • Option+arrow / Command+arrow in Terminal

    Hello,
    I'm using quite often the those two key combination to skip respectively a word or go at the end/beginning of a line.
    I'm also using terminal quite often (my Linux part ;)) but those combination don't work there and I have the use the [bash-like shortcuts|http://www.ice2o.com/bashquickref.html]. Note that all of them don't work such as move fwd/back one word.
    Any idea how to make option/command+arrows work ?
    Thanks,
    Tex

    Any idea how to make option/command+arrows work ?
    You can see whether option-arrow and command-arrow generate anything that bash can work with using the following:
    cat -v
    no press the keys you hope bash will see.
    When I played with this, I say that option-arrow generated a different escape sequence from just arrow keys.
    But command-arrow up/down affected scrolling into the saved previous screen info. command left/right did nothing.
    For the option-arrow keys you could create a set of bash bind commands in your .bash_profile to remap that escape sequence into the bash commands that do what you want.
    For Command-arrow you would need to use a hotkey mapping utility that translates command-arrow into the bash commands you desire.
    And yes, you should pursue terminal and bash questions in the Unix forum as suggested.

  • Bash command question

    I volunteered to download my school's entire website, as the current host is going into liquidation and they can't get a copy of the database. So I downloaded the whole thing with wget. Now, the problem is that many (several hundred) of the files have names like "featureDetails.asp?featureID=2", which is fine on a JFS partition, but can't be on a FAT partition.
    So, my question is, how do I replace all "?"s, and "="s with "-"?
    PS: I really have no idea where to post this, so picked this board at random

    fwojciec wrote:
    If it's just a matter of renaming the files then you can use something line this:
    for i in *; do j=$(echo "$i" | sed 's/?/-/g;s/=/-/g'); mv "$i" "$j"; done
    This will rename all files in the current directory.
    EDIT:
    or something like this would work as well:
    for i in *; do j=$(echo "$i" | sed 's/[?=]/-/g'); echo "$i" "$j"; done
    These certainly work, and for small jobs they are reasonable, but they are both very inefficient because a new process is forked for every file to be renamed.  Instead consider this:
    for i in *; do mv "$i" "${i//\?/-/}" ; done
    This syntax is documented in the "Parameter Expansion" portion of the bash(1) manpage.

  • [DONE] Bash scripting. A few questions

    Hi,
    I've created my own custom sleep script as it is described here: https://wiki.archlinux.org/index.php/Sy … stem-sleep and it's already working correctly.
    However I've got a few questions concerning bash scripting since I've never did it before.
    Here the example from the wiki:
    #!/bin/sh
    case $1/$2 in
    pre/*)
    echo "Going to $2..."
    post/*)
    echo "Waking up from $2..."
    esac
    Now what do I need the /*) for in the cases pre and post? What does it do? And why isn't there any *) in the end which would exit the script if none of the above is true?
    Secondly, why does it say case $1/$2 in, but not case $1 in, what is the $2 needed for? E.g. in this script only $1 is used: https://wiki.archlinux.org/index.php/OS … ibernation
    And third question is, if I do really need the double quotes around $1? Does it make any difference?
    Sorry for my incompetence but I'm not a dev and as I already said I've never did any bash scripting...
    Thanks in advance
    best regards
    nuc
    Last edited by nuc (2013-02-07 18:10:56)

    ok, here's my actual code:
    #!/bin/sh
    suspend_osssound()
    /usr/lib/oss/scripts/killprocs.sh
    /usr/sbin/soundoff
    resume_osssound()
    /usr/sbin/soundon
    case "$1" in
    pre)
    suspend_osssound
    post)
    resume_osssound
    *) exit $NA
    esac
    It is the same as the one in the OSS wiki entry, but slightly configured to work under logind and not pm-utils. Of course the new location is /usr/lib/systemd/system-sleep/.
    I'm about to update the wiki with my code, so I'd like to know if there aren't any major mistakes. I tested it and it works but I want to get sure
    PS: Do people actually still use pm-utils for suspending or can I safely remove the previous script from the wiki?
    EDIT: Added double quotes
    Last edited by nuc (2013-01-25 23:42:02)

  • Questions concerning basic bash scripting

    Good evening,
    at the moment we do bash scripting at university, but I seen to encounter some problems in understanding the functionality of bash. I would be very grateful if you guys could help me out with one or another question.
    First one:
    Task to accomplish: Scripts with three arguments. $1 -> source directory, $2 -> file suffix, $3 -> target directory. Search source directory for all files with suffix $2 and copy them to $3.
    I tried to do it, using pipe and xargs, but I am wondering how to pass the filenames found over the pipe.
    find $source -name "*.$suffix" | xargs cp [MISSING ARGUMENT] $target
    How do I access the data I need to fill in as first argument of cp, or isn't it possible to accomplish the task this way?
    Regards,
    cg

    chaosgeisterchen wrote:find $source -name "*.$suffix" | xargs cp [MISSING ARGUMENT] $target
    Almost, you just need the -t flag to cp which basically reverses the order of SOURCE and TARGET in this instance
    find $source -name "*.$suffix" | xargs cp -t $target
    Also, I suggest you escape the * in your find to prevent bash expanding it. Bash shouldn't expand, find should.
    You might like to also use the -iname (as opposed to -name) predicate to find if you don't care about the case of the source files.
    Last edited by fukawi2 (2008-06-02 03:13:37)

  • [Solved] - Bash scripting - variable question.

    Hi!
    I have a little problem, I want to get data from a variable, but the variable-name that I want to
    get the data from is constructed by another variable.
    Let me explain with a little non-working example:
    test1="data1"
    test2="data2"
    test3="data3"
    for i in {1..3};do
    echo value=$[test$i];done
    I want to get the output of this code to be:
    value=data1
    value=data2
    value=data3
    and I cannot use arrays in the script I'm working on. I know how to do this in other languages
    but cannot figure it out how to do it in bash.
    Please help!
    Last edited by JSHN (2009-10-06 19:55:15)

    you need the eval command to finish how you started:
    eval echo value=\$test$i
    Otherwise, use bash arrays:
    test=('data1' 'data2' 'data3')
    for i in $(seq 0 2);do # zero-based...
    echo value=${test[$i]}
    done
    ninja-edit to remove the comma's in the array
    Last edited by klixon (2009-10-06 19:27:03)

Maybe you are looking for

  • How to get a list of users in cms that have viewed a report?

    Hello. Is there a query that I can use in Query Builder to find out the users that have viewed a report - or a set of reports, and how many times those users have viewed the report(s) within the past year or so? Thanks Joel

  • I'm not able to open documents saved from the internet.

    I'm not able to open documents saved from the internet. I'm using a macbook pro en Adobe Acrobat X 10.1.10. I tried: file - export als PDF and save as PDF, none of this works. I always receive a message stating an error and saying that I need to go b

  • Mail subject modification for smart-form SMIV

    Hi Experts, We have implemented ServiceDesk in Solution Manager 7.1 SPS 08 & are using automatic notifications to be generated as alert emails to the customer key users / service desk support team / message processors etc. We are using Actions under

  • Rebates - Partial Settlement

    Hi, I need to partially settle an agreement but when i select create the credit memo, it creates a message. Message reads: The plant is missing for transaction xxxxx. I've checked the customers on the rebate condition as well as the materials and the

  • Purchase requisition against a contract

    Hi experts!!! I have created a purchase requisition with reference to a contract and in the valuation tab of the purchase requisition (field valuation price) the system is proposing the moving average price of the item instead of the price of the con