Shell script not working

Hi
All,
I have oracle 9i and 10g on unix. now i have 920.env and 1020.en file to set p respective enviornment.
when I excecute this commnad
. $HOME/920.env from the shell prompt it is working fine. and also same for 1020.env .
Now same command . $HOME/920.env i am putting in shell script and trying to execute that script but it is not executing.
i don't know what to do.
Thank you
vishal

now as i understand that statement is executing but it's scope is only with in the script. when it complete it's execution all varialble reset to it's by defualt .profile so that statement in the script set variable with in the scope of the script only.
Thanks for your help
Vishal

Similar Messages

  • Hardcode password in a do shell script not working

    I have been trying to solve something i have wanted to do for a long time, that is get a script that changes the ammount of time before the display goes to sleep. I tried GUi scripting but in system preferences the changes made to the slider did not stay. So i have now come onto a do shell script. Found below. I would prefer to just hardcode my password into it however this does not seem to work. Any ideas ?
    set exitflag to false
    try
    repeat until exitflag is true
    set {text returned:Sleeptime, button returned:sleepstate} to (display dialog "Minutes before display sleep" & return & "Between 1 and 180 mintues" & return & "Greater than 180 means never sleep" default answer "1" buttons {"Cancel", "OK"} default button 2)
    set Sleeptime to Sleeptime as number
    if Sleeptime is less than 1 then
    set exitflag to false
    else if Sleeptime is greater than 180 then
    set Sleeptime to 0
    set exitflag to true
    else
    set exitflag to true
    end if
    end repeat
    end try
    set Sleeptime1 to Sleeptime as string
    set Sleeptime1 to quoted form of Sleeptime1
    set psswd to quoted form of "XXXXX"
    do shell script "sudo pmset -a displaysleep " & Sleeptime1 password psswd
    set pete to do shell script "sudo pmset -g"
    set xx to text -2 thru -1 of pete
    if xx - Sleeptime = 0 then
    tell application "SEC Helper"
    show screen message "Worked:" & return & xx & " mintues"
    end tell
    else
    tell application "SEC Helper"
    show screen message "Failed!"
    end tell
    end if

    1) don't use 'sudo' in a 'do shell script'. It isn't necessary and will sometimes break.
    2) do not use 'sudo' in a 'do shell script'
    3) do not use... I'm sure you get the idea.
    It is not necessary to use 'sudo' in a 'do shell script' command. 'do shell script' itself takes care of the authentication element when you use 'with administrator privileges'. Therefore the appropriate way of doing this is:
    <pre class=command>do shell script "pmset -g displaysleep " & sleeptime1 with administrator privileges password psswd</pre>
    If you omit the 'password psswd' element the user will be prompted to authenticate using the standard system authentication dialog.
    The problem you're running into is that the 'password' parameter is only valid when you use 'with adminitrator privileges', and is therefore getting ignored in your current script.

  • My cold backup shell script not working

    I have written a shell script for cold backup but. It says that line 42 has unexpected syntex error '{' and line 57 unexpected end of file. Please help
    BKUP_DIR=/u03/backups/abu/nightly_backup
    LOG_FILE=/u03/backups/abu/backup.log
    ORACLE_HOME= /u01/app/oracle/product/10.2; export ORACLE_HOME
    ORACLE_SID=SEED; export ORACLE_SID
    PATH="$PATH:$ORACLE_HOME/bin";export PATH
    # Execute the backup procedure
    echo ymd=`date +%Y%m%d` >> $LOG_FILE
    echo "Database BACKUP starting." >> $LOG_FILE
    ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
    ORACLE_SID=SEED; export ORACLE_SID
    PATH="$PATH:$ORACLE_HOME/bin";export PATH
    rman target=/ << EOF
    shutdown immediate
    EOF
    if [ $? -eq 0 ]
    then
    mkdir -p ${BKUP_DIR} # make directory
    echo "Database shut down.">> $LOG_FILE
    else echo "not shutdown".>> $LOG_FILE
    fi
    if [ ! -d ${BKUP_DIR} ]
    then
    echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
    exit 1
    fi
    echo "Previous Backup is being removed." >> $LOG_FILE
    rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
    echo "Cold backup being performed." >> $LOG_FILE
    cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
    cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    echo "Cold backup of archive logs being performed." >> $LOG_FILE
    mv /u01/app/oracle/product/10.2/dbs/arch/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    gzip ${BKUP_DIR}/$ymd-${cmsv}
    echo "Restarting Database" >> $LOG_FILE
    rman target=/ << EOF
    startup
    EOF
    else
    echo "Database will NOT start up." >> $LOG_FILE
    fi
    echo 'ymd='date +%Y%m%d' >> $LOG_FILE
    echo "Database BACKUP has completed." >> $LOG_FILE
    exit

    I trying to write that script for our new production database. My script will create a folder automatically and will copy all database files into the folder. Now my script dont copy the files into the direcory that automatically create. I want my directory name with timestamp that i already speciy in my code. The scripts now generate an error that now such files or directory. I mean when it tries to copy files from source to destination folder. Please give me some suggestions.
    if [ $? -eq 0 ]
    then
    mkdir -p ${BKUP_DIR} # make directory
    echo "Database shut down.">> $LOG_FILE
    else echo "not shutdown".>> $LOG_FILE
    fi
    if [ ! -d ${BKUP_DIR} ]
    then
    echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
    exit 1
    fi
    echo "Previous Backup is being removed." >> $LOG_FILE
    rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
    echo "Cold backup being performed." >> $LOG_FILE
    cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
    cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gzecho "Cold backup of archive logs being performed." >> $LOG_FILE

  • Process Flow - User Defined object calling Unix Shell script not working

    Hi, I have a User Defined Object in a Process Flow with the following parameters :-
    Command: /usr/bin/ksh
    Parameter List:
    Result Code:
    Script: cd /shell_scripts
    ./dwh_get_datafile.sh param1 param2 param3
    Success Threshold: 0
    The script executes but it does not correctly interpret all the Unix commands within it e.g command such as FTP, DATE, GREP etc.
    In the job details I can see :-
    ./dwh_get_datafile.sh: date: not found
    ./dwh_get_datafile.sh: ftp: not found
    ./dwh_get_datafile.sh: grep: not found
    ./dwh_get_datafile.sh: rm: not found
    ./dwh_get_datafile.sh: ls: not found
    ./dwh_get_datafile.sh: awk: not found
    Anyone know what I have done wrong ?
    The script runs fine when run as a Unix script while logged into Telnet.
    Thanks.
    Paul

    The shell script is executed by the oracle user in the unix environment so make sure that the directorie where you can find the unix commands exists in the path for the oracle user in .profile as you can se in my example below.
    PATH=$PATH:$ORACLE_HOME/bin:$OWBHOME/bin:/ASW/ora_script:/local/bstat:/usr/bin:/opt/bin:/usr/local/bin; export PATH
    /JZ

  • Connect internal in shell script not working

    Oracle: 11.2.0.1 in AIX env
    I export ORACLE_SID and then try to connect internal but I get connected to idle instance. What am I missing???
    this block is in a .sh script
    export ORACLE_SID=ufms203
    $ORACLE_HOME/bin/sqlplus /nolog <<EOF
    connect / as sysdba
    WHENEVER SQLERROR EXIT;
    select instance_name from v$instance;
    OUTPUT *********************
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 29 09:43:05 2011
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    SQL> Connected to an idle instance.
    SQL> SQL> SQL> select instance_name from v
    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    Session ID: 0 Serial number: 0
    Disconnected

    The instance is started:
    k801ora@jd1su143 in /a0143/d01/scripts : ps -ef | grep ufms203
    k801ora 8794340 1 0 12:32:46 - 0:00 oracleufms203 (LOCAL=NO)
    k801ora 8929434 1 0 09:33:52 - 0:00 ora_w001_ufms203
    k801ora 10248348 1 0 Mar 22 - 2:24 ora_pmon_ufms203
    k801ora 10359024 1 0 Mar 22 - 0:15 ora_gen0_ufms203
    k801ora 10379478 1 0 Mar 22 - 7:50 ora_vktm_ufms203
    k801ora 10399748 1 0 Mar 22 - 0:40 ora_dbw0_ufms203
    k801ora 10408158 1 0 Mar 22 - 1:19 ora_psp0_ufms203
    k801ora 10420478 1 0 Mar 22 - 0:16 ora_mman_ufms203
    k801ora 10428426 1 0 Mar 22 - 0:16 ora_diag_ufms203
    k801ora 10436840 1 0 Mar 22 - 0:17 ora_dbrm_ufms203
    k801ora 10440938 1 0 Mar 22 - 12:00 ora_dia0_ufms203
    k801ora 10445048 1 0 Mar 22 - 2:51 ora_ckpt_ufms203
    k801ora 10449134 1 0 Mar 22 - 0:38 ora_dbw1_ufms203
    k801ora 10453232 1 0 Mar 22 - 0:35 ora_dbw2_ufms203
    k801ora 10457330 1 0 Mar 22 - 0:35 ora_dbw3_ufms203
    k801ora 10461428 1 0 Mar 22 - 0:47 ora_lgwr_ufms203
    k801ora 10465530 1 0 Mar 22 - 0:04 ora_reco_ufms203
    k801ora 10469624 1 0 Mar 22 - 0:55 ora_smon_ufms203
    k801ora 10473726 1 0 Mar 22 - 4:42 ora_mmnl_ufms203
    k801ora 10477820 1 0 Mar 22 - 2:43 ora_mmon_ufms203
    k801ora 10485770 1 0 Mar 22 - 0:08 ora_q002_ufms203
    k801ora 10489864 1 0 Mar 22 - 0:07 ora_qmnc_ufms203
    k801ora 10506270 1 0 Mar 22 - 0:04 ora_q000_ufms203
    k801ora 10530842 1 0 Mar 22 - 0:04 ora_q001_ufms203
    k801ora 10588214 1 0 Mar 22 - 0:19 ora_smco_ufms203
    k801ora 11124888 10510484 2 09:54:04 pts/0 0:00 grep ufms203
    k801ora 11796592 1 0 09:35:19 - 0:00 ora_w000_ufms203
    k801ora 12431386 1 0 09:53:53 - 0:00 ora_w002_ufms203
    k801ora 12484794 1 0 12:32:41 - 0:11 oracleufms203 (LOCAL=NO)
    k801ora 16023576 1 0 12:32:04 - 1:12 oracleufms203 (LOCAL=NO)
    k801ora 16629976 1 0 09:25:21 - 0:00 ora_w005_ufms203

  • Modify shell script to work with other folders

    i am trying to modify a shell script that sorts files in a course folder into sub folders by month. I have a shell script that works, but when i try to modify it for another course folder it quits working. can someone let me know what i am doing wrong?
    the working shell script:
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do if [ ! -d \"$f\" ]; then
    x=\"${f%%.*}\"
    i=$((${#x}-3))
    if [ -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
    mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
    fi
    fi
    done"
    the nonworking modified script:
    do shell script "
    for f in \"$HOME/Desktop/DOEP Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DOEP monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DOEP monthly/${f:$i:3}\"
            fi
        fi
    done"

    ok here is the applescript that works.
    property total_student : 1
    tell application "Finder"
      set master_path to alias "Users:macbook:Desktop:DWI Annual Report:Annual Report.xlsx"
      set filesWithDWI to get every file of folder ((path to desktop folder) & "DWI Annual Report" as string) whose name contains "DWI"
      repeat with f in filesWithDWI
      my transfer_data(f, master_path)
      end repeat
    end tell
    on transfer_data(child_path, master_path)
      tell application "Microsoft Excel"
      set child_book to (open workbook workbook file name (child_path as string))
      set child_doc to worksheet 1 of child_book
      set master to worksheet "sheet 1" of (open workbook workbook file name (master_path as string))
      set num to 15 --All lists start at index 12 or later, I'm putting 10 to be safe
      set students to {}
      tell child_doc --grab values from child document
      repeat until (value of cell (("A" & num) as string)) is 1
      set num to num + 1
      end repeat
      repeat until (value of cell (("B" & num) as string)) is ""
      set end of students to {namevalue of cell (("B" & num) as string)), driver_idvalue of cell (("C" & num) as string)), DOBvalue of cell (("D" & num) as string)), Ref_Recvalue of cell (("I" & num) as string)), pre_testvalue of cell (("J" & num) as string)), post_testvalue of cell (("K" & num) as string)), cert_idvalue of cell (("L" & num) as string))}
    set num to num + 1
      end repeat
      set startdate to range "C7"
      set classlocation to range "C11"
      set instructor to range "H7"
      end tell
      tell master
      set num to 7
      log (value of cell (("B" & num) as string))
      repeat until (value of cell (("B" & num) as string)) is ""
      set num to num + 1
      end repeat
      repeat with student in students
      set value of cell (("A" & num) as string) to total_student
      set value of cell (("B" & num) as string) to name of student
      set value of cell (("C" & num) as string) to driver_id of student
      set value of cell (("D" & num) as string) to DOB of student
      set value of cell (("H" & num) as string) to pre_test of student
      set value of cell (("I" & num) as string) to post_test of student
      set value of cell (("J" & num) as string) to cert_id of student
      set value of cell (("f" & num) as string) to startdate
      set value of cell (("E" & num) as string) to classlocation
      set value of cell (("G" & num) as string) to instructor
      set value of cell (("K" & num) as string) to Ref_Rec of student
      set num to num + 1
      set total_student to total_student + 1
      end repeat
      end tell
      save child_book
      close child_book
      save active workbook in master_path
      close active workbook
      end tell
    end transfer_data
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
            fi
        fi
    done"
    It takes the class rosters and copies the information from the class roster to the annual report and then moves the file to the monthly  folder and files it in the appropriate months folder based on the last three letters of the file name.

  • Powershell unzip with shell.application not working when launched from windows service

    I have a deployment agent on a machine implemented as a windows service. Service is 32-bit and runs on windows server 2008R2 x64 SP1 with powershell V2. Powershell script requires elevation and to run under x64 because of dependency to powershell module
    'IIS Administration'. To achieve this, the service starts a cmd file which in turn launches powershell x64 console:
    C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe "Start-Process C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ArgumentList '-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File C:\Temp\EndJobCmd\Install.ps1' -Verb RunAs"
    This seems to work well. The problem I have is that the script has a sequence where it unpacks a zip file to a destination folder using shell.application, this works fine when triggered manually on the server or through the task scheduler, but when triggered
    from the service it does not extract any files at all (cannot see any errors thrown by the script but it seems to continue to execute as it logs a successful message to the event log after finishing).
    Unzip sequence looks like:
    $shell = New-Object -com shell.application
    $pkg = $shell.namespace($sourceFile)
    $installDir = $shell.namespace($targetDir)
    $installDir.Copyhere($pkg.items(), 20)
    Any advice greatly appreciated. I have searched some and seen a few people with similar issue but have yet to find a solution.

    If it's still actual, I managed to fix this with having CopyHere params equal 1564. 
    So in my case extract zip function looks like:
    function Expand-ZIPFile{
    param(
    $file, $destination
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item,1564)
    "$($item.path) extracted"
    1564 description can be found here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx:
    (4) Do not display a progress dialog box.
    (8) Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    (16) Respond with "Yes to All" for any dialog box that is displayed.
    (512) Do not confirm the creation of a new directory if the operation requires one to be created.
    (1024) Do not display a user interface if an error occurs.

  • Shell Script not getting invoked in File adapter

    Hi all,
    Requirement:
    PI need to pick the file from source directory and send it to target directory using SFTP.
    I'm using SCP command for this purpose.
    When I run the shell script (with simple SCP command) from command prompt, script is working fine.
    Same script is called from PI File adapter but script is not getting invoked.
    In the communication channel logs, "Executed OS command" is available. There are no Error/Warning messages in the log.
    NFS transport protocol is used in the File communication channel.
    Complete directory path of the shell script is mentioned in File channel -> Run Operating System command after message processing.
    Even the following simple command is not working from PI receiver file channel:
    echo "Test file" >> /data/test.txt
    Please let me know if I'm missing out something.
    Thanks,
    Geetha

    Hi Geetha,
    I think the syntax u are using is not correct. Please follow the below syntax:
    /path/<script_name> %F
    for ex: /staging/Interface/XI/Script/FTPData %F
    use the above in the communication channel.
    %F should be after a space.
    FTPData is the script name
    /staging/Interface/XI/Script/ is the location where the script is present
    Cheers,
    Souvik
    Edited by: Souvik Chatterjee on Apr 14, 2011 3:38 PM

  • Sunstudio startup script not working

    The environment is Ubuntu Linux 5.04 with Java 1.5.0_01 installed.
    The awk script that checks the Java Version has some problems on this distribution.
    Enabled set -x in the sunstudio shell script, here are the relevant lines:
    +++ '[' -x /shares/free/opt/jdk1.5.0_01/bin/java ']'
    +++ /shares/free/opt/jdk1.5.0_01/bin/java -version
    +++ /usr/bin/awk -f /opt/sun/sunstudio10u1/prod/scripts/ver.awk
    awk: run time error: regular expression compile failed (missing operand)
    "| |(|)|,|
            FILENAME="" FNR=0 NR=0
    ++ ver=
    +++ /opt/sun/sunstudio10u1/prod/scripts/jdk_compare 1.3.9 ''
    ++ gettext -e 'Warning: Ignoring JDK_HOME. Sun Studio does not run with this\nversion of the J2SE.\n'
    +++ '[' -x /shares/free/opt/jdk1.5.0_01/bin/java ']'
    +++ /usr/bin/awk -f /opt/sun/sunstudio10u1/prod/scripts/ver.awk
    +++ /shares/free/opt/jdk1.5.0_01/bin/java -version
    awk: run time error: regular expression compile failed (missing operand)
    "| |(|)|,|
            FILENAME="" FNR=0 NR=0
    ++ ver=
    +++ /opt/sun/sunstudio10u1/prod/scripts/jdk_compare 1.3.9 ''
    ++ for d in '"${JDKLIST[@]}"'
    ++ '[' -x /usr/j2se/bin/java -a -x /usr/j2se/bin/javac ']'The rest of the utilities seem to work correctly, netbeans starts up correctly.

    The awk script was written and tested on various
    platforms, both
    Linux and Solaris. I'm not familiar with Ubuntu Linux
    and thats not
    one of the platforms we tested on.=====
    www.ubuntulinux.org
    Could you do several things for me?
    First, could you do some sanity testing on
    /usr/bin/awk. Just
    enough to make sure its working in other uses. If it
    does, can
    you see if its a symlink to gawk? If so, what version
    of gawk
    (you can do "awk --version" if it is). On the Linux
    platform I have
    (SuSE Linux Enterprise System 9), I get "GNU Awk
    3.1.3". If you
    can send me the exact version of awk, I might be able
    to come
    up with an alternative.=====
    The installed awk was a symlink to mawk.
    I installed also the GNU awk and that fixed it.
    You might also be able to fix this. Do you have write
    permissions
    on your sunstudio install? If you look at the ver.awk
    script it has
    a comment giving an alternate value of the FS which
    is easier
    to read, but doesn't work on Solaris (where
    /usr/bin/awk isn't
    GNU awk). Since we have to work with both GNU and
    Solaris
    awk, I didn't use this alternate. But if that works
    on your system
    its a simple way of getting you going.
    Of course, you're still not on a supported Linux
    platform, so there
    are still no guarantees you won't run into other
    problems. These
    would most likely be in some of the native
    executables the IDE
    uses (such as dbx and dmake). The core parts of the
    IDE (all
    Java parts), should work fine on most any Linux
    platform.=====
    Encountered the problem with dbx dependency to libc:
    $ dbx
    dbx: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.3.4' not found (required by dbx)
    $ ldd -v /lib/tls/i686/cmov/libc.so.6
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
    Version information:
    /lib/tls/i686/cmov/libc.so.6:
    ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
    ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
    ld-linux.so.2 (GLIBC_2.0) => /lib/ld-linux.so.2
    ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
    $ ldd /opt/sun/sunstudio10u1/bin/dbx
    /opt/sun/sunstudio10u1/bin/dbx: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.3.4' not found (required by /opt/sun/sunstudio10u1/bin/dbx)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7fce000)
    libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xb7f14000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7ef3000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7ee7000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7dba000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7feb000)
    Was there a reason why this version of GNU libc was chosen as minimal requirementl!?

  • UDM and shell scripts and working with the ENVIRONMENT variable options

    In Userdefined metrics you have the ability to pass envronment variables.
    I was going to send
    DIR=/db/db05/oradata/ORCL/hot
    How to handle whats passed to the shell script?
    It passes $1 as {DIR=/db/db05/oradata/ORCL/hot}
    yes with the brackets. Here I figured it would simply set the DIR environment variable.
    Any cool tricks to work with this mess?
    Is it meant for perl scripts instead?
    Daryl.

    Ilmari Aalto wrote:
    Hi Darth,
    Thanks for your hint! Nevertheless I think it's something more profound, since there's no error etc. For example, should I have the path wrong I assume that OWB would return me some kind of an error when it doesn't find the .sh-file? Isn't there any log-file to see whether the command was executed? It seems like the execution of the User Defined element would be skipped altogether.
    Cheers,
    IlmariNo, if you don't give an absolute path OWB will not return any error, it just wont do anything at all...

  • Script not working anymore(SOLVED)

    I made a basic script and it was working fine for a few hours.I went to work,got back and it stopped working.
    I created a folder in  my ~/bin directory and used export PATH=$PATH:~/bin,also i gave the script execution privileges
    with chmod 755 pac so I'm not sure where i went wrong .The only thing that comes to mind is that i didn't use chmod u=x pac.
    Btw I used echo $PATH and my ~/bin directory was there.As soon as i use the export command again it works
    Last edited by unilx (2011-03-05 17:40:18)

    I'm still a noob at this but i think it's shell scripting,here is my script:
    I use pac to execute this one
    1 #!/bin/bash -
    2 #===============================================================================
    3 #
    4 # FILE: pow.sh
    5 #
    6 # USAGE: ./pow.sh
    7 #
    8 # DESCRIPTION: A script to execute powerpill and do a system,refresh,refresh,update.
    9 #
    10 # OPTIONS: ---
    11 # REQUIREMENTS: ---
    12 # BUGS: ---
    13 # NOTES: ---
    14 # AUTHOR:
    15 # COMPANY:
    16 # CREATED: 03/04/2011 04:20:50 AM AST
    17 # REVISION: 1.0
    18 #===============================================================================
    19
    20 set -o nounset # Treat unset variables as an error
    21
    22 clear
    23
    24 echo "Hello unilx"
    25
    26 date
    27
    28 sudo pacman-color -Syyu
    29
    30 echo "System update complete"
    31
    32 clear
    33
    34 exit
    and pow for this one
    1 #!/bin/bash -
    2 #===============================================================================
    3 #
    4 # FILE: pow.sh
    5 #
    6 # USAGE: ./pow.sh
    7 #
    8 # DESCRIPTION: A script to execute powerpill and do a system,refresh,refresh,update.
    9 #
    10 # OPTIONS: ---
    11 # REQUIREMENTS: ---
    12 # BUGS: ---
    13 # NOTES: ---
    14 # AUTHOR:
    15 # COMPANY:
    16 # CREATED: 03/04/2011 04:20:50 AM AST
    17 # REVISION: 1.0
    18 #===============================================================================
    19
    20 set -o nounset # Treat unset variables as an error
    21
    22 clear
    23
    24 echo "Hello unilx"
    25
    26 date
    27
    28 sudo powerpill -Syyu
    29
    30 echo "System update complete"
    31
    32 clear
    33
    34 exit
    and this was the error:
    bash: pac: command not found
    the same with pow
    I know both files say pow.sh.It was a mistake that i just noticed now.I used vim pow.sh to start the syntax and renamed it to pow with :w pow
    Last edited by unilx (2011-03-04 20:06:59)

  • Desktop picture making script not working under 10.6

    I have a script that starts the TeamViewer application on my server and then makes pictures of the running application and sends them per email to me so I can see it is running on my server.
    Under 10.5 it worked always (still does), under 10.6 it does not. Any ideas as to why?
    Here is the script:
    set dFolder to "~/Desktop/"
    do shell script ("mkdir -p " & dFolder)
    repeat 2 times -- Repeat XX times.
    activate application "TeamViewer"
    delay 1
    set tTime to do shell script "date +%H-%M-%S"
    do shell script ("/usr/sbin/screencapture " & dFolder & tTime & ".png") -- Capture screen.
    delay 5 --
    end repeat
    thanks

    And after you've started screen sharing, you could just take a screenshot:
    property N : 0
    set N to N + 1
    set picPath to ((POSIX path of (path to desktop)) & "Picture_" & N & ".png") as string
    do shell script "screencapture -tjpg " & quoted form of picPath
    Code taken from TUAW.

  • Script not working in SharePoint content editor webpart

    Hi All,
    <html>
    <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script language="javascript" type="text/javascript">
    $(document).ready(function () {
    //Call your function here like
    //retrieveListItems();
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "SP.js");
    var siteUrl = '/vceo/PMO/EPMO/';
    var close1 = ''; var close2 = ''; var high = ''; var low = ''; var medium = ''; var lowMedium = ''; var mediumHigh = '';
    var open1 = ''; var open2 = ''; var high1 = ''; var low1 = ''; var medium1 = ''; var lowMedium1 = ''; var mediumHigh1 = '';
    var count = 0; var count1 = 0;
    var initiate = 0; var planning = 0; var execution = 0; var closing = 0;
    var sumMinimal = 0; var sumModerate = 0; var sumCritical = 0; var sumSevere = 0;
    var sumHighlyLikely = 0; var sumLikely = 0; var sumSomewhat = 0; var sumUnlikely = 0;
    var sumBudget = 0; var sumCommitted = 0; var sumConsumption = 0;
    function retrieveListItems() {
    alert("Welcome to Dashboard");
    var clientContext = new SP.ClientContext(siteUrl); alert("site url");
    var oList = clientContext.get_web().get_lists().getByTitle('Project Issues and Risks');
    var oList1 = clientContext.get_web().get_lists().getByTitle('Project');
    var oList2 = clientContext.get_web().get_lists().getByTitle('Risk Impact');
    var oList3 = clientContext.get_web().get_lists().getByTitle('Risk Probability'); alert("get by title");
    var camlQuery = new SP.CamlQuery(); var camlQuery1 = new SP.CamlQuery(); var camlQuery2 = new SP.CamlQuery(); var camlQuery3 = new SP.CamlQuery(); var camlQuery4 = new SP.CamlQuery(); var camlQuery5 = new SP.CamlQuery(); var camlQuery6 = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Issue</Value></Eq></Where></Query></View>');
    camlQuery1.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Risk</Value></Eq></Where></Query></View>');
    camlQuery2.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Open</Value></Eq></Where></Query></View>');
    camlQuery3.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Closed</Value></Eq></Where></Query></View>');
    camlQuery4.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery5.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery6.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    this.collListItem = oList.getItems(camlQuery); this.collListItem1 = oList.getItems(camlQuery1); this.collListItem2 = oList1.getItems(camlQuery2); this.collListItem3 = oList1.getItems(camlQuery3);
    this.collListItem4 = oList2.getItems(camlQuery4); this.collListItem5 = oList3.getItems(camlQuery5); this.collListItem6 = oList1.getItems(camlQuery6);
    clientContext.load(collListItem); clientContext.load(collListItem1); clientContext.load(collListItem2); clientContext.load(collListItem3); clientContext.load(collListItem4); clientContext.load(collListItem5); clientContext.load(collListItem6);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    alert("retrieve list");
    function onQuerySucceeded(sender, args) {
    alert("succeed");
    var listItemEnumerator = collListItem.getEnumerator(); var listItemEnumerator1 = collListItem1.getEnumerator(); var listItemEnumerator2 = collListItem2.getEnumerator();
    var listItemEnumerator3 = collListItem3.getEnumerator(); var listItemEnumerator4 = collListItem4.getEnumerator(); var listItemEnumerator5 = collListItem5.getEnumerator(); var listItemEnumerator6 = collListItem6.getEnumerator();
    var sumClose = 0; var sumClose1 = 0; var sumHigh = 0; var sumMedium = 0; var sumLow = 0; var sumLowMedium = 0; var sumMediumHigh = 0;
    var sumOpen = 0; var sumOpen1 = 0; var sumHigh1 = 0; var sumMedium1 = 0; var sumLow1 = 0; var sumLowMedium1 = 0; var sumMediumHigh1 = 0;
    while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); sumClose += oListItem.get_item('Close'); sumOpen += oListItem.get_item('Open'); sumHigh += oListItem.get_item('High'); sumMedium += oListItem.get_item('Medium'); sumLow += oListItem.get_item('Low'); sumLowMedium += oListItem.get_item('LowMedium'); sumMediumHigh += oListItem.get_item('MediumHigh'); }
    while (listItemEnumerator1.moveNext()) { var oListItem1 = listItemEnumerator1.get_current(); sumClose1 += oListItem1.get_item('Close'); sumOpen1 += oListItem1.get_item('Open'); sumHigh1 += oListItem1.get_item('High'); sumMedium1 += oListItem1.get_item('Medium'); sumLow1 += oListItem1.get_item('Low'); sumLowMedium1 += oListItem1.get_item('LowMedium'); sumMediumHigh1 += oListItem1.get_item('MediumHigh'); }
    while (listItemEnumerator4.moveNext()) { var oListItem4 = listItemEnumerator4.get_current(); sumMinimal += oListItem4.get_item('Minimal'); sumModerate += oListItem4.get_item('Moderate'); sumSevere += oListItem4.get_item('Severe'); sumCritical += oListItem4.get_item('Critical'); }
    while (listItemEnumerator5.moveNext()) { var oListItem5 = listItemEnumerator5.get_current(); sumUnlikely += oListItem5.get_item('Unlikely'); sumSomewhat += oListItem5.get_item('Somewhat'); sumLikely += oListItem5.get_item('Likely'); sumHighlyLikely += oListItem5.get_item('HighlyLikely'); }
    while (listItemEnumerator6.moveNext()) { var oListItem6 = listItemEnumerator6.get_current(); sumBudget += oListItem6.get_item('Project_x0020_Budget_x0020_Amoun'); sumCommitted += oListItem6.get_item('Committed_x0020_Budget'); }
    count = this.collListItem2.get_count();
    count1 = this.collListItem3.get_count();
    while (listItemEnumerator2.moveNext()) {
    var oListItem2 = listItemEnumerator2.get_current();
    var stat = oListItem2.get_item('Project_x0020_Status');
    if (stat == "Intiation") {
    initiate = initiate + 1
    if (stat == "Planning") {
    planning = planning + 1
    if (stat == "Execution") {
    execution = execution + 1
    if (stat == "Closing") {
    closing = closing + 1
    //alert("initiate" + initiate); alert("planning" + planning); alert("execution" + execution); alert("closing" + closing);
    //alert("countOpen" + count); alert("closed:" + count1);
    window.close1 = sumClose; window.close2 = sumClose1; window.high = sumHigh; window.low = sumLow; window.medium = sumMedium; window.mediumHigh = sumMediumHigh; window.lowMedium = sumLowMedium;
    window.open1 = sumOpen; window.open2 = sumOpen1; window.high1 = sumHigh1; window.low1 = sumLow1; window.medium1 = sumMedium1; window.mediumHigh1 = sumMediumHigh1; window.lowMedium1 = sumLowMedium1;
    drawChart();
    function onQueryFailed(sender, args) { alert('Request failed.. ' + args.get_message() + '\n' + args.get_stackTrace()); }
    google.load("visualization", "1", { packages: ["corechart"] });
    function drawChart() {
    var data = google.visualization.arrayToDataTable([['Task', 'Issues'], ['Close', window.close1], ['Open', window.open1]]);
    var data1 = google.visualization.arrayToDataTable([['Task', 'Risks'], ['Close', window.close2], ['Open', window.open2]]);
    var data2 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high, window.mediumHigh, window.medium, window.lowMedium, window.low]]);
    var data3 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high1, window.mediumHigh1, window.medium1, window.lowMedium1, window.low1]]);
    var data4 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Closed', count1], ['Open', count]]);
    var data5 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Initiation', initiate], ['Planning', planning], ['Execution', execution], ['Closing', closing]]);
    var data6 = google.visualization.arrayToDataTable([['Program', 'Impact'], ['Minimal', sumMinimal], ['Moderate', sumModerate], ['Severe', sumSevere], ['Critical', sumCritical]]);
    var data7 = google.visualization.arrayToDataTable([['Program', 'Probability'], ['Highly Likely/Probable(76%-100%)', sumHighlyLikely], ['Likely(51%-76%)', sumLikely], ['Somewhat Likely(26%-50%)', sumSomewhat], ['Unlikely/Improbable(0%-25%)', sumUnlikely]]);
    var data8 = google.visualization.arrayToDataTable([['Project', 'Budget'], ['Approved', sumBudget], ['Committed', sumCommitted]]);
    var options = { title: 'Program Issues', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options1 = { title: 'Program Risks', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options2 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options3 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options4 = { title: 'Project Status', width: 225, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options5 = { width: 175, height: 200, legend: { position: 'top', maxLines: 10 }, pieSliceText: 'value', };
    var options6 = { title: 'Program Risk Impact', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options7 = { title: 'Program Risk Probable', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options8 = { title: 'Project Budget', width: 300, height: 300, legend: 'bottom', pieSliceText: 'value', };
    var chart = new google.visualization.PieChart(document.getElementById('chart_div3'));
    chart.draw(data, options);
    var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));
    chart1.draw(data1, options1);
    var chart2 = new google.visualization.ColumnChart(document.getElementById('chart_div1'));
    chart2.draw(data2, options2);
    var chart3 = new google.visualization.ColumnChart(document.getElementById('chart_div2'));
    chart3.draw(data3, options3);
    var chart4 = new google.visualization.PieChart(document.getElementById('chart_div4'));
    chart4.draw(data4, options4);
    var chart5 = new google.visualization.PieChart(document.getElementById('chart_div5'));
    chart5.draw(data5, options5);
    var chart6 = new google.visualization.PieChart(document.getElementById('chart_div6'));
    chart6.draw(data6, options6);
    var chart7 = new google.visualization.PieChart(document.getElementById('chart_div7'));
    chart7.draw(data7, options7);
    var chart8 = new google.visualization.ColumnChart(document.getElementById('chart_div8'));
    chart8.draw(data8, options8);
    </script>
    </head>
    <body>
    <table >
    <tbody>
    <tr>
    <td id="chart_div8" colspan="2" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div4" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div5" style="border-bottom:ridge;border-right:ridge;border-top:ridge"></td>
    </tr>
    <tr>
    <td id="chart_div" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div2" style="border-bottom:ridge;"></td>
    <td id="chart_div3" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div1" style="border-bottom:ridge;border-right:ridge""></td>
    </tr>
    <tr>
    <td id="chart_div6" colspan="2" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div7" colspan="2" style="border-bottom:ridge;border-left:ridge;border-right:ridge"></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>
    This content editor webpart not working in sharepoint page. Once I checked out to the page then chart is working. When i checkedin function not get called. How to fix this?
    THanks in advance!

    In SharePoint 2013, sp.js and sp.runtime.js does not load on the page in published mode. You need to explicitly load these files. You can check using IE developer tools in the Script section that in published mode these files are missing.
    In order to fix this issue explictly refer these two js files on your page.
    <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="_layouts/15/sp.js"></script>
    Geetanjali Arora | My blogs |

  • Simple button script not working

    I am using AS2 and need help figuring out why this simple button script is not working:
    stop();
    buttonWS1.onRelease = function(){
                        gotoAndStop("Stage1and2_Boss",4);
    buttonWS2.onRelease = function(){
                        nextFrame();
    //end
    My buttons are the square letter-puzzles below. They are images that I converted to "symbols" (specifically, buttons). I put their names as above (buttonWS1, buttonWS2, etc.) in the "instance names" boxes.
    I have no idea what is going on. Please help!

    Hi -
    1. Yes, buttonWS2 is the instance name
    2. The only code attached to it is the code I pasted above.
    3. onRelease does not execute because my trace statement does not appear in the output
    Here is the modified code for buttonWS2:
    buttonWS2.onRelease = function(){
                        trace("clicked!");
                        nextFrame();
    Question: It shouldn't matter if I have commented-out code within that set of codes should it?:
    buttonWS2.onRelease = function(){
              //if (puzzleschosenarray[0] == 2 || puzzleschosenarray[1] == 2) {
              // cannot be chosen -- make button non-functional
              //else{
                        //puzzleschosenarray[roundnumber-1] = 2;
                        trace("clicked!");
                        nextFrame();

  • Java script not working in 1 pdf, but same script is NOT working in other

    Dear Experts,
    I have a problem with java script.
    I have created 2 PDFs with the same Form name and sub form names.
    I have written a javascript and this script seems to be working in one (Demand2.pdf) and NOT working in the other (Sample.pdf).
    The link for Demand2.pdf is
    https://acrobat.com/#d=XIydWx1RIU4oNdTySHtHfg
    and the link for sample.pdf is
    https://acrobat.com/#d=sKPRs2dtDY57RSvMVtnh3w
    Can you please guide me on this.
    Many Thanks
    BookFans

    Hi,
    The second file (Sample.pdf) is saved as Static. The script is changing the visual appearance of the form (showing and hiding objects). This requires the file to be saved as a Dynamic PDF. This is available in the save-as dialogue under the file name.
    Good luck,
    Niall

Maybe you are looking for