Simple bash scripting help needed..

I want to learn som simple bash scripting in order to automate various tasks.. Im totally noob, so bear with me
First of all I would like to set configs without using nano.. is there a simple command for this? For example if i want change my hostname in /etc/rc.conf.. how can i print the current vallue and how can i change it`?
i was thinking something like this to get the current value:
# cat /etc/rc.conf | grep HOSTNAME=
which returns HOSTNAME="myhostname"
how can i change this value with one or more commands whitout touching the rest of the file?

abesto wrote:
A slightly naive solution:
CHOICE="lisa"
NAMES="homer marge lisa bart maggie"
if [ "`echo \" $NAMES \" | grep \" $CHOICE \"`" ]; then
echo "this is how you do it"
fi
The extra spaces inside the escaped quotes are to ensure that only a whole word is "matched".
You can also replace the elif's with a loop through a list of "the other variables". Then you'd use the loop variable instead of $CHOICE above.
grep can check on word-bounderies with \< and \>, or with the -w switch. The -q switch suppresses any messages and exits with exit-code 0 when the first match is found:
if echo "${NAMES}" | grep -qw "${CHOICE}"; then
Nice and readable, should work, but i haven't tested it
EDIT:
Procyon wrote:CHOICE="lisa"
NAMES="homer marge lisa bart maggie"
if [[ $NAMES =~ $CHOICE ]]; then echo match; fi
This one also matches elisa, ie. no check on word bounderies. You should be carefull with that
Last edited by klixon (2009-04-23 09:40:22)

Similar Messages

  • Solaris 11 - run a simple BASH script on computer startup

    I need to have a simple BASH script run on my Solaris 11 machine automatically whenever the computer (re)starts. It should be run with root permissions and after the computer has fully booted. What is the easiest way to do that?
    Thank you
    Dusan

    Hi user9368043
    Yes, that should be right, and be intended this way.
    See /etc/rc3.d/README and the following part from smf(5):
    Legacy Startup Scripts
    Startup programs in the /etc/rc?.d directories are executed
    as part of the corresponding run-level milestone:
    /etc/rcS.d milestone/single-user:default
    /etc/rc2.d milestone/multi-user:default
    /etc/rc3.d milestone/multi-user-server:default
    Your question concerning upgrading to Solaris 11.1:
    In the Gnome menus, you should look for (and start)
    System --> Administration --> Update Manager
    Let it do its work. It will give you a new boot environment, containing Solaris 11.1. Possibly, you have to perform upgrading twice. With "beadm activate", see beadm(1M), you can go back to Solaris 11.0 whenever you want.
    "Local" parts of your zfs root pool, like /usr/local, home directories, /root, and so on, should be in separated file systems, and be mounted outside the root pool before upgrading. They are availlable then from any boot environment, and will not be duplicated. See more in zfs(1M), zpool(1M).
    I strongly recommend upgrading. Solaris 11.1 is great.

  • Simple BASH script to update subversion files

    This is just a simple BASH script that will update all .svn files in a specified directory.  If an update fails, it will attempt to update all the subdirectories in the failed one, so as much will be updated as possible.  Theoretically, you should be able to supply this script with only your root directory ( / ), and all the .svn files on your computer will be updated.
    #! /bin/bash
    # Contributor: Dylon Edwards <[email protected]>
    # ================================
    # svnup: Updates subversion files.
    # ================================
    #  If the user supplies no arguments
    #+ then, update the current directory
    #+ else, update each of those specified
    [[ $# == 0 ]] \
        && dirs=($PWD) \
        || dirs=($@)
    # Update the target directories
    for target in ${dirs[@]}; do
        # If the target file contains a .svn file
        if [[ -d $target/.svn ]]; then
            # Update the target
            svn up $target || {
                # If the update fails, update each of its subdirectories
                for subdir in $( ls $target ); do
                    [[ -d $target/$subdir ]] &&
                        ( svnup $target/$subdir )
                done
        # If the target file doesn't contain a .svn file
        else
            # Update each of its subdirectories
            for subdir in $( ls $target ); do
                [[ -d $target/$subdir ]] &&
                    ( svnup $target/$subdir )
            done;
        fi
    done

    Cerebral wrote:
    To filter out blank lines, you could just modify the awk command:
    ${exec awk '!/^$/ { print "-", $_ }' stuffigottado.txt}
    very nice; awk and grep: two commands that never cease to amaze me.

  • Another simple bash script to clean pacman cache

    here is a simple script that I have written which cleans pacman cache folder in a way that only the packages which are now "updated" in the repositories, will get removed. This is different from what "pacman -Sc" does. pacman -Sc also removes any package which is not installed, while this script keeps all the packages which are updated whether they are installed or not.
    The functionality is some how like what "apt-get autoclean" does in debian.
    to use this script you need to run it with "list" or "clean" arguments.  you can also use the "help" argument for more help.
    I hope it helps
    #! /bin/bash
    # clcache - This script cleans pacman cache folder in a way that only the packages
    #+ which are now updated in the repositories, will get removed. This is
    #+ different from what "pacman -Sc" does. pacman -Sc also removes any package
    #+ which is not installed, while this script keeps all the packages which are
    #+ updated whether they are installed or not.
    # I have tweaked this script to be as fast as possible, it might still need a
    #+ couple of minutes to compelete based on the size of your cache folder.
    # to use this script you need to run it with "list" or "clean" arguments.
    # you can also use the "help" argument for more help.
    # This script is written by "Ali Mousavi". Please report bugs to [email protected]
    DIR="/var/cache/pacman/pkg" #the default directory of pacman cache.
    ROOT_UID=0 #Only users with $UID 0 have root privilages.
    TMPFILE="/tmp/cache.tmp"
    # Run as root
    if [ "$UID" -ne "$ROOT_UID" ]
    then
    echo "Must be root to run this script"
    exit 1
    fi
    # Check for the arguments
    if [ -z "$1" ]
    then
    echo -e 'What should I do?\nValid Argument are "list", "clean" or "help"'
    exit 1
    elif [ "$1" = "list" ]
    then
    ACTION="ls"
    MESSAGE="Are you sure you want to continue?"
    elif [ "$1" = "clean" ]
    then
    ACTION="rm -vf"
    MESSAGE="Are you sure you want to remove outdated packages? This process can not be undone!"
    elif [ "$1" = "help" -o "$1" = "-h" -o "$1" = "--help" ]
    then
    echo -e "This script checks the packages in your pacman cache directory and removes the packages that are outdated. It doesn't matter if the package is installed or not.\n\n3 arguments can be passed to the script:\n\nlist:\n\tchecks for package that are outdated and prints the names.\n\nclean:\n\tremoves outdated packages.\n\nhelp,-h,--help:\n\tprints this help text.\n\nThis script is written by \"Ali Mousavi\". Please report bugs to [email protected]"
    exit 0
    else
    echo 'Valid Argument are "list", "clean" or "help"'
    exit 1
    fi
    # Check if the user is sure!
    echo "This might take a while based on the amount of cached packages."
    echo -n "$MESSAGE(y/n) "
    read ANS
    if [ $ANS = "y" -o $ANS = "Y" -o $ANS = "yes" ]
    then
    echo "Processing packages..."
    elif [ $ANS = "n" -o $ANS = "N" -o $ANS = "No" ]
    then
    echo "Exiting on user request"
    exit 0
    else
    echo "Invalid answer"
    exit 1
    fi
    # Process the packages
    cd $DIR #change to cache directory.
    pacman -Sl | awk '{ print $2" "$3; }' > $TMPFILE
    for f in $(ls $DIR)
    do
    pname=$(file $f | cut -d: -f1) #Produces filename, like: fetchmail-6.3.19-1-i686.pkg.tar.xz"
    spname=$(echo $pname | sed 's/-[0-9][0-9]*.*//g') #removes package version: fetchmail
    pver=$(echo $pname | sed 's/.*-\([0-9\-\.][0-9\-\.]*-[0-9\-\.][0-9\-\.]*\).*/\1/g') #using pacman -Qi for all files takes a lot of time.
    if [ $(echo $pver | grep '[^0-9\-\.\-\-]' | wc -l) != 0 ] #checks if package version is alright
    then
    pver=$(pacman -Qpi $f | grep Version | awk '{print $3}')
    fi
    newpver=$(grep -e "^$spname " $TMPFILE | awk '{ print $2 }')
    if [[ $newpver != $pver ]]
    then
    $ACTION $f
    fi
    done
    rm -f $TMPFILE
    echo "Outdated packages processed successfully!"
    exit 0
    Last edited by tuxitop (2011-09-13 09:24:26)

    tuxitop wrote:# Check for the arguments
    if [ -z "$1" ]
    then
    echo -e 'What should I do?\nValid Argument are "list", "clean" or "help"'
    exit 1
    elif [ "$1" = "list" ]
    then
    ACTION="ls"
    MESSAGE="Are you sure you want to continue?"
    elif [ "$1" = "clean" ]
    then
    ACTION="rm -vf"
    MESSAGE="Are you sure you want to remove outdated packages? This process can not be undone!"
    elif [ "$1" = "help" -o "$1" = "-h" -o "$1" = "--help" ]
    then
    echo -e "This script checks the packages in your pacman cache directory and removes the packages that are outdated. It doesn't matter if the package is installed or not.\n\n3 arguments can be passed to the script:\n\nlist:\n\tchecks for package that are outdated and prints the names.\n\nclean:\n\tremoves outdated packages.\n\nhelp,-h,--help:\n\tprints this help text.\n\nThis script is written by \"Ali Mousavi\". Please report bugs to [email protected]"
    exit 0
    else
    echo 'Valid Argument are "list", "clean" or "help"'
    exit 1
    fi
    1. `echo -e 'foo\nbar\nbaz'` gets long and unreadable quickly. Instead, use here documents:
    cat <<EOF
    What should I do?
    Valid Argument are "list", "clean" or "help"
    EOF
    2. Use a case command, looks cleaner:
    case "$1" in
    list) ... ;;
    clean) ... ;;
    help|-h|--hep) ... ;;
    # Check if the user is sure!
    echo "This might take a while based on the amount of cached packages."
    echo -n "$MESSAGE(y/n) "
    read ANS
    if [ $ANS = "y" -o $ANS = "Y" -o $ANS = "yes" ]
    then
    echo "Processing packages..."
    elif [ $ANS = "n" -o $ANS = "N" -o $ANS = "No" ]
    then
    echo "Exiting on user request"
    exit 0
    else
    echo "Invalid answer"
    exit 1
    fi
    Try:
    read -p "hello: " -r
    echo $REPLY
    And again, `case` should be cleaner in this case.
    # Process the packages
    cd $DIR #change to cache directory.
    pacman -Sl | awk '{ print $2" "$3; }' > $TMPFILE
    While you quoted a lot, you left these two out. "$DIR" and "$TMPFILE" should be quoted, otherwise whitespaces will break the code.
    for f in $(ls $DIR)
    Apart from the same missing quotes, calling `ls` is a waste here. The following is sufficient and (maybe surprisingly) more accurate:
    for f in *
    How is it more accurate? Run this test script:
    #!/bin/bash
    DIR=/tmp/foo
    mkdir -p "$DIR"
    cd "$DIR"
    touch a\ b c$'\n'd
    for i in *; do
    printf '+%s+\n' "$i"
    done
    printf '%s\n' ---
    for i in $(ls $DIR); do
    printf '+%s+\n' "$i"
    done
    Let's not go too far here. Just get the idea.
    do
    pname=$(file $f | cut -d: -f1) #Produces filename, like: fetchmail-6.3.19-1-i686.pkg.tar.xz"
    Calling `file` here is, again, unnecessary. Also, filename of a package can contain ":", e.g., vi-1:050325-1-i686.pkg.tar.xz, which breaks your code.
    Don't complicate things:
    pname=$f
    spname=$(echo $pname | sed 's/-[0-9][0-9]*.*//g') #removes package version: fetchmail
    Broken for ntfs-3g-2011.4.12-1-i686.pkg.tar.xz, nvidia-173xx-utils-173.14.31-1-i686.pkg.tar.xz, etc...   Something less lousy:
    sed 's/\(-[^-]\+\)\{3\}$//' <<< "$pname"
    pver=$(echo $pname | sed 's/.*-\([0-9\-\.][0-9\-\.]*-[0-9\-\.][0-9\-\.]*\).*/\1/g') #using pacman -Qi for all files takes a lot of time.
    Although this might work for now, this would break if we had an architecture that starts with a digit, e.g. 686.  Something less lousy:
    sed 's/\(.*\)-\([^-]\+-[^-]\+\)-[^-]\+$/\2/' <<< "$pname"
    if [ $(echo $pver | grep '[^0-9\-\.\-\-]' | wc -l) != 0 ] #checks if package version is alright
    then
    pver=$(pacman -Qpi $f | grep Version | awk '{print $3}')
    fi
    Again, calling `wc` here is a waste. Anyway, why is this check necessary at all?
    newpver=$(grep -e "^$spname " $TMPFILE | awk '{ print $2 }')
    if [[ $newpver != $pver ]]
    then
    $ACTION $f
    fi
    done
    rm -f $TMPFILE
    echo "Outdated packages processed successfully!"
    exit 0
    The post is getting too long, so so much from me. If there's anything you don't understand yet, read bash(1).
    If I sound harsh or anything, don't be discouraged. Just keep reading, keep improving.
    Last edited by lolilolicon (2011-09-13 12:53:04)

  • Bash script help?

    I really need to get a good book to read and learn some bash scripting so I can do this myself. but this is only the 3rd or 4th time i've come here asking
    I was hoping someone might be able to assist me again
    I'm trying to organize my movie folder again. I've let it go too long
    basically, i'm looking for a bash script to go through my folder of movies. each movie has it's own folder with an avi, jpg and nfo. I need the files in the folders to be the same name as the parent folder
    so lets say i have this
    movie title folder (2012)
    -movie_file_2012.avi
    -an_nfo_file.nfo
    -a_jpg.jpg
    I want to turn into this
    movie title folder (2012)
    -movie title folder (2012).avi
    -movie title folder (2012).nfo
    -movie title folder (2012).jpg
    anyone?

    ssl6 wrote:
    I really need to get a good book to read and learn some bash scripting so I can do this myself. but this is only the 3rd or 4th time i've come here asking
    I was hoping someone might be able to assist me again
    I'm trying to organize my movie folder again. I've let it go too long
    basically, i'm looking for a bash script to go through my folder of movies. each movie has it's own folder with an avi, jpg and nfo. I need the files in the folders to be the same name as the parent folder
    so lets say i have this
    movie title folder (2012)
    -movie_file_2012.avi
    -an_nfo_file.nfo
    -a_jpg.jpg
    I want to turn into this
    movie title folder (2012)
    -movie title folder (2012).avi
    -movie title folder (2012).nfo
    -movie title folder (2012).jpg
    anyone?
    I won't do the work for you, but if you're willing to look things up and try to write a working script that does what you've described--I'll be happy to help flush out problem areas.
    Okay, so what you want is to turn
    Movies/:
    A-Movie-I-love.avi
    A-Movie-I-love.nfo
    A-Movie-I-love.jpg
    A-Movie-about-Llamas.avi # :P
    A-Movie-about-Llamas.nfo
    A-Movie-about-Llamas.jpg
    into this:
    Movies/:
    A-Movie-I-love/:
    A-Movie-I-love.avi
    A-Movie-I-love.nfo
    A-Movie-I-love.jpg
    A-Movie-about-Llamas/:
    A-Movie-about-Llamas.avi
    A-Movie-about-Llamas.nfo
    A-Movie-about-Llamas.jpg
    right?
    Last edited by lspci (2013-04-23 20:40:30)

  • Simple bash script to add a '-' [Solved]

    I need to write a small bash script to add a '-' to each line in a file before displaying via conky!
    Todo
    - Get Milk
    - Buy Food
    - Pay Bills
    Currently I use
    TEXT
    Todo
    ${hr}
    ${head /home/mrgreen/.stuffigottado.txt 30 20}
    In .conkyrc but have to add '-' each time I edit .stuffigottado.txt
    Thanks in advance....

    Cerebral wrote:
    To filter out blank lines, you could just modify the awk command:
    ${exec awk '!/^$/ { print "-", $_ }' stuffigottado.txt}
    very nice; awk and grep: two commands that never cease to amaze me.

  • [solved] Help with simple bash script

    #!/bin/bash
    current_state=cat /home/phil/.screen_state
    if ["$current_state" = "laptop"];
    then
    disper -S
    echo TV > .screen_state
    else
    disper -s
    echo laptop > .screen_state
    fi
    [phil@pwned ~]$ ./screenswitch.sh
    ./screenswitch.sh: line 3: /home/phil/.screen_state: Permission denied
    ./screenswitch.sh: line 5: [: missing `]'
    [phil@pwned ~]$ cat /home/phil/.screen_state
    laptop
    [phil@pwned ~]$
    I'm not sure why I'm getting the permission denied, and also I can't see whats wrong with line 5.
    Last edited by Dethredic (2011-08-21 19:46:57)

    IIRC you need spaces
    if [ "foo" = "foo" ]; then
    between '[' and another character.
    Edit: Got it.
    current_state=cat /home/phil/.screen_state
    This is plain wrong. I get 'Permission denied' too.
    Try
    current_state=$(cat /home/phil/.screen_state)
    Last edited by karol (2011-08-21 17:59:16)

  • Newbie bash scripting help!

    Hello,
    I would like some help with a simple script.
    I have say 10 text files (***.txt) in a directory.  I want to make each *** into a subdirectory, insert the respective ***.txt file into that subdirectory as well as insert three other files into each subdirectory.
    I then want to create a loop that will run a seperate script, which I already have, on each folder.
    Thanks for any help

    DonVla wrote:
    jnwebb wrote:
    Hello,
    I would like some help with a simple script.
    I have say 10 text files (***.txt) in a directory.  I want to make each *** into a subdirectory, insert the respective ***.txt file into that subdirectory as well as insert three other files into each subdirectory.
    I then want to create a loop that will run a seperate script, which I already have, on each folder.
    Thanks for any help
    i think you need some basics:
    http://www.gnu.org/software/bash/manual/bashref.html
    http://wooledge.org:8000/BashGuide
    http://wooledge.org:8000/BashFAQ
    http://wooledge.org:8000/BashPitfalls
    http://sed.sourceforge.net/sed1line.txt
    http://student.northpark.edu/pemente/awk/awk1line.txt
    Sorry for always being so propagandish, but I feel it's worthwile for your enjoyment and efficiency to mention that perl does all this and more. http://perldoc.perl.org
    But, uh, "use the right tool for the right job". For the last 3 characters problem, briest gives the right solution. It works for me. Make sure you put the '-' in front of the 3.

  • Report Script Help Needed

    Hi,
    I have not written one in years and am having trouble with a fairly simple one (I think). Was wondering if you could take a look. Anyways we have 11 dimensions which may make this impossible due to performance. I basically need a report script to perform a data extract. Data requirements for each dimension would be:
    Scenario: Budget
    Version: Final
    CCCC: Tot_CCCC (Rollup)
    SCCC: Tot_SCCC (Rollup)
    Charge_Type: Charge_Type_Total (Rollup)
    Resource: NU_RESC (Rollup)
    SAU_CAU_Facility: Zero level members of "NU_Consolidated"
    Account: Zero level members of "TOTCO_FERC"
    Activity: Zero level members of "NU_Actv"
    Years: Children of "YEARS"
    Periods: Jan to Dec only
    Report format would suppress the PAGE thus Budget and Final would not appear.
    Was also hoping to somehow suppress CCCC, SCCC, Charge_Type and Resource(Not sure if possible).
    Thus format would look something like this tab delimited:
    Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    SAU_CAU_Facility Account Activity Year 100 200 100 100 010 100 200 300 100 100 100 100
    Here is what I have so far. I have not been able to get it to return any results even though I have loaded one row of fake data. Does anything jump out at you as to what I'm doing wrong? Appreciate any help you may have as I'm really stuck as it's been years since I have tried this.
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    // This report script extracts data from NUMaster
    <SUPSHARE
    {DECIMAL 4}
    {NAMEWIDTH 25}
    {SUPCOMMAS}
    {SUPBRACKETS}
    {SUPPAGEHEADING}
    {NOINDENTGEN}
    {SUPMISSINGROWS}
    {SUPZEROROWS}
    {TABDELIMIT}
    {SUPFEED}
    {ROWREPEAT}
    <PAGE ("SCENARIO", "VERSION")
    "BUDGET" "FINAL"
    <COLUMN ("PERIOD")
    "JAN"
    "FEB"
    "MAR"
    "APR"
    "MAY"
    "JUN"
    "JUL"
    "AUG"
    "SEP"
    "OCT"
    "NOV"
    "DEC"
    <ROW ("RESOURCE_LOCATION", "SCCC", "CCCC", "VERSION", "CHARGE_TYPE", "SCENARIO", "SAU_CAU_FACILITY", "ACCOUNT", "ACTIVITY", "YEARS")
    <DIMBOTTOM "SAU_CAU_Facility"
    <DIMBOTTOM "ACCOUNT"
    <DIMBOTTOM "ACTIVITY"
    <DIMBOTTOM "YEARS"
    "TOT_CCCC"
    "TOT_SCCC"
    "CHARGE_TYPE_TOTAL"
    "NU_RESC"
    // Limits the members within the specified dimensions to the correct zero level members of the specified rollup
    <LINK (<DESCENDANTS ("NU_CONSOLIDATED") AND <LEV("SAU_CAU_Facility",0))
    <LINK (<DESCENDANTS ("TOTCO_FERC") AND <LEV("ACCOUNT",0))
    <LINK (<DESCENDANTS ("NU_Actv") AND <LEV("ACTIVITY",0))
    Thanks,
    SAm

    One thing that may help - it looks like you're using both <DIMBOTTOM and <LINK for three of your dimensions.
    <DIMBOTTOM "SAU_CAU_Facility"
    <DIMBOTTOM "ACCOUNT"
    <DIMBOTTOM "ACTIVITY"
    You should just need the <LINK and not the <DIMBOTTOM. <DIMBOTTOM's can really kill report script performance.
    Whenever I do these, I try to start small, and then open the report script up to more and more members to see what's affecting performance. I'd start with one year, one facility, one activity, one account, etc. Then slowly add in the full member specifications you want.
    Hope this helps,
    - Jake

  • Simple BIP Report help needed

    Hi All ,
    I am bit new to BI Publisher,I have done plenty of Oracle reports 6i and 10g.
    Have read the BIPublisher Guide as well,but could not understand a few points.
    suppose I want to build a very very simple report like
    Sysdate Sysdate Sysdate
    16-Oct-08 16-Oct-08 16-Oct-08
    step 1) I will write the following query in the Data Model and store/save it.
    select sysdate ,sysdate,sysdate from dual.
    Step 2) In the layout model I want to use .rtf layout .So in the MS word .rdf document I create /insert
    a table with 2 rows and 3 columns,where 1st row will have Sysdate in all 3 columns as header.
    Now to fetch date 3times(the data) from the above query,WHAT is going to be my next steps ????
    I am not able to understand the link between the layout(.rtf document) and XML document.
    Please can someone reply to this question and let me know ?
    Regards
    Sunny

    I added a useless parameter just so you could see where parms should go...
    Datatemplate:
    <dataTemplate name="A_SIMPLE_REPORT">
         <properties>
              <property name="xml_tag_case" value="upper"/>
         </properties>
         <parameters>
              <parameter name="P_PARM" dataType="character"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="QUERYNAME">
                   <![CDATA[
    select sysdate SYSDATE1
    , sysdate SYSDATE2
    , sysdate SYSDATE3
    from dual
    where 'XYZ' = nvl(:P_PARM, 'XYZ')
    ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_UPPERGROUP" dataType="varchar2" source="QUERYNAME">
                   <element name="SYSDATE1" dataType="varchar2" value="SYSDATE1"/>
                   <element name="SYSDATE2" dataType="varchar2" value="SYSDATE2"/>
    <element name="SYSDATE3" dataType="varchar2" value="SYSDATE3"/>
              </group>
         </dataStructure>
         <dataTrigger name="afterReportTrigger" source="A_SIMPLE_REPORT.afterreport()"/>
    </dataTemplate>
    XML OUPUT:
    <?xml version="1.0" encoding="UTF-8" ?>
    <A_SIMPLE_REPORT>
    <LIST_G_UPPERGROUP>
    <G_UPPERGROUP>
    <SYSDATE1>2008-10-16T18:20:19.000-05:00</SYSDATE1>
    <SYSDATE2>2008-10-16T18:20:19.000-05:00</SYSDATE2>
    <SYSDATE3>2008-10-16T18:20:19.000-05:00</SYSDATE3>
    </G_UPPERGROUP>
    </LIST_G_UPPERGROUP>
    </A_SIMPLE_REPORT>
    Hope this helps,
    Scott
    PS If you have been doing reports for as long as you say you prob. know this already...but I NEVER* trust Oracle to convert my dates. I convert them all to char, pass them and convert them on "the other side" (if needed). But, you can change the data type to date if you feel brave, but don't say I didn't warn you. ;-)

  • Report Script Help Needed - Data Extract

    Hi,
    I have a cube with 11 dims: Account, Period, Resource, Facility, SSSS, CCCC, Activity, Years, Version, Scenario, Charges
    I need a report script that will extract data for a certain year and scenario only. I have not written a report script in a long time and have the following thus far. However it's not extracting data that I know exists. Can anyone help? Thanks is advance. This runs but I just get a blank screen or file....
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    // This report script extracts data from cube
    "FY11"
    {DECIMAL 4}
    {NAMEWIDTH 25}
    {SUPCOMMAS}
    {SUPBRACKETS}
    {SUPPAGEHEADING}
    {NOINDENTGEN}
    {SUPMISSINGROWS}
    {SUPZEROROWS}
    {TABDELIMIT}
    {SUPFEED}
    {ROWREPEAT}
    "JAN"
    "FEB"
    "MAR"
    //"APR"
    //"MAY"
    //"JUN"
    //"JUL"
    //"AUG"
    //"SEP"
    //"OCT"
    //"NOV"
    //"DEC"
    "BUDGET"
    // This is the members of the CCCC dimension to extract
    // This is the members or the ACCOUNT dimension to extract
    !

    Hello -
    You can try/modify the code below and see if this works -
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    { SUPMISSINGROWS }
    { SUPZEROROWS }
    { SUPFEED, SUPBRACKETS, SUPCOMMAS }
    { NOINDENTGEN }
    { DECIMAL 4}
    { NAMEWIDTH 30 }
    { ROWREPEAT }
    { TABDELIMIT }
    {MISSINGTEXT "-" }
    <PAGE ("Scenario", "Resource", "Facility" ,"SSSS", "Activity", "Version", "Charges")
    "Budget"
    "Resource"
    "Facility"
    "SSSS"
    "Activity"
    "Version"
    "Charges"
    <COLUMN ("Year","Period")
    "FY11"
    "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
    <ROW ("Account", "CCCC")
    <LINK (<DESCENDANTS ("ACCOUNT") AND <LEV("ACCOUNT",0))
    <LINK (<DESCENDANTS ("RT9_CCCC") AND <LEV("CCCC",0))
    Here you may want to change teh combination in the Page dimensions for eg -
    I know for Scenario you want Budget
    But for Version should it be "Version" or may be "Working" Or "Final" or any other version dimension member ...?
    Same way modify the dimension memebres for other dimensions.
    Regards
    Edited by: Rosi on Aug 24, 2009 10:01 AM
    Edited by: Rosi on Aug 24, 2009 10:02 AM

  • TCL script help needed on Nexus7000 !

    Does anyone know how to create a TCL script on Nexus7000 switch for following scenario ? Need urgent help here.. :-
    Here is what I am trying to do :-
    1. Whenever following log on "show log log" prints out :-
    testnexus7000 %PIXM-2-PIXM_SYSLOG_MESSAGE_TYPE_CRIT:
    2. Print out the output of show system internal pixm errors
    And look for following line :-
    [102] pixm_send_msg_mcast(1208): MTS Send to LC X failed >> where X is 0 based
    and this error can occur multiple times for different LCs too.
    4. Reload line card (s) X and syslog " task done"
    Regards
    Vijaya

    Hi,
    Vijaya I found same post on support cisco forums So people helped someone in same question !!!!!!
    Please read it ....
    https://supportforums.cisco.com/thread/2128886
    Yes plus if u can help me in ......Cisco ASA same security problem than that will be good for me .....I will contact u and will be great help for me if u help
    Hope that link help u .....
    Bye,

  • UCCX Conferencing in third call? Scripting help needed

    All,
    I've got a customer requirement where they want to be able to place a call into the contact centre, give the contact centre the digits to dial and have the contact centre place the call on their behalf.  I've got no trouble with that bit.
    The next requirement is that the call placed is recorded, even if the calls in are not from cisco phones (i.e. mobiles).  We have a redbox recorder that does the recording and in order for it to commence a recording session, it needs to see a setup message through CM to check that it's an extension that is to be recorded.
    For example, I use an IP phone that IS being monitored to make a call.  The Redbox sees the setup and will record the call flow.
    I use an IP phone that is NOT being monitored to make a call.  The Redbox sees the setup and will not record the call.
    In order to get calls recorded from the contact centre, I'm thinking of conferencing in a third phone that Redbox is set to record and have it auto answer on silent, but I can't figure out how to get the three calls conferenced together to keep the call flow recorded.
    Any thoughts on how to achieve this?  Or has anyone else out there used another method?
    All help greatly appreciated!
    LH
    #15331

    There is no mechanism within CCX that allows you to initiate a conference or join two contacts together. Your only options will be to transfer the triggerin
    g contact to another destination with a Call Redirect or Call Consult Transfer.  If you create a second contact and use a Place Call step, you can interact with both contacts in the script but never join them together.

  • Simple HTML page HELP needed

    Hi all,
    Here's my dilemma:
    I've got this simple html page that I've made with
    dreamweaver CS3. On the starting page I want to put a section
    called "NEWS", under which there would be essentially a texfield
    with the news. Now, I don't want to put the news text in the html
    code. Rather, I'd like the code to somehow take this text from a
    separate text file which I could edit at will and simply overwrite
    on the host server so that changes are seen in browsers.
    I don't need a real CMS (besides, CMS is way over my head).
    Just this one text field. I've tried with the textfield/text
    area/HTML object/etc. in the 'insert' tool but none worked. Can
    this be done at all? Appreciate any help.

    macioo1 wrote:
    > Now, I don't want to put the news text in
    > the html code. Rather, I'd like the code to somehow take
    this text from a
    > separate text file which I could edit at will and simply
    overwrite on the host
    > server so that changes are seen in browsers.
    You can do this with a server-side include. The first thing
    you need to
    do is to find out whether your hosting company has enabled
    server-side
    includes, or if you have access to a server-side language
    such as ASP or
    PHP. The way that you create a server-side include is
    slightly different
    in each type of setup.
    When you have found what your remote server supports, someone
    can give
    you further instructions.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Simple java applet help needed

    hi, im having trouble with an applet im developing for a project.
    i have developed an applet with asks the user for simple information( name,address and phone) through textfields, i wish for the applet to store this information in an array when an add button below the textfeilds is pressed.
    client array[];
    array=new client[];//needs to be an infinate array!
    I have created the client class with all the set and get methods plus constructors needed but i dont know how to take the text typed into the textfields by the user and store them in the array.
    i also need to save this info to a file and be able to load it back into the applet.
    Could some please help! Thank you for your time.

    Better maybe redefine the idea using an data structure :
    public class client{
    private char name[];
    private char address[];
    private int phone;
    public class vector_clients{
    private client vect[];
    // methods for vect[]
    What is your opinion about ???

Maybe you are looking for

  • Problem with iSight/Photo Booth

    Hey all, I've had my MacBook for 2 days now and the isight camera stopped working earlier today. I used the camera to video conference earlier using iChat and everything worked fine. Now, when I go into Photo Booth or iChat the camera wont work. The

  • How to adjust output in sqlplus

    Hi I want to take a report from the below query from unix sqlplus. However the output of the query is not tidy. I used set linesize 121, but it doesnt work again.Any other suggestion? select tb.owner,count(*) "current_extents",ex.segment_name,tb.max_

  • Getting remote address in applet

    hi guys, how to get client ip in an applet.i tried lot with each n every possible combination but it always gives u Localhost/127.0.0.1. first i tried with this line of code... clientIP=InetAddress.getLocalHost().getHostAddress(); then i tried with t

  • Go-item in post-text-item oracle forms 6i

    It is not possible to use go_item in post-text-item trigger in forms 6i How to overcome this?

  • Web Service - XI - RFC

    Hi, I have a Web Service <-> XI <-> RFC scenery. I've already done the Design, but a I have some questions about configuration... What do I have to configure to make R/3 understand that it has been started? Tks, Daniela