Search Results

Search found 25663 results on 1027 pages for 'script programmer'.

Page 33/1027 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Script Task/Component and Template Information

    The Script Task and Script component are often used by people developing SSIS packages because they are easy to use and now because SSIS could be perceived to be more developer friendly they are very powerful. That being said we should no be using them everywhere.  There are generally Tasks/Components already provided that will do the job it may be that we have to rethink the way we want to draw our package. I had cause last week to break out the script component in SQL Server 2008 SP1 and found that it was broken.  I don’t know when it broke as I do not use them all that often.  My error was as below.     Something must have overwritten this template information.  I looked in Event Viewer and tried the things it suggested but the templates still did not work.  Here is how I got them eventually to work for me (Your Mileage may vary) Open up a Command Prompt window using an administrator level account and “as an administrator” vsta.exe /hostid SSIS_ScriptTask /setup vsta.exe /hostid SSIS_ScriptComponent /setup   This worked for me.  Hope it helps.

    Read the article

  • Bash script not adding variables to session

    - by travega
    I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment. #! /bin/bash alias devhm='cd ${DEV_HOME}; ll'; alias wlhm='cd ${WL_HOME}; ll'; alias dirch='watch --interval=1 "ls -la"'; alias vols='watch --interval=1 "df -h"'; alias svn-update='svn update --depth infinity ./*'; alias mci="~/mci.sh"; alias vncserver="vncserver -geometry 1680x1050"; alias ..="cd .."; alias hist="history | grep "; export PROXY_HOST=proxy.my.setup; export PROXY_PORT=3128; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/usr/lib/oracle/12.1/client64/lib; export ORACLE_HOME=/usr/lib/oracle/12.1/client64; export TNS_ADMIN=${ORACLE_HOME}/network/admin; echo "DONE!"; But none of these values are available in my terminal sessions anymore. Even when I run the script straight into the terminal like so: ./setup.sh I see the "DONE!" prompt printed but no aliases or env variables are set. If I copy and paste the contents of the file into the terminal the aliases and env variables are set. I have tried adding a line to execute the script from .bashrc also but still no aliases or env variables set. Any ideas what might be going on here? Also could anyone suggest a better way to have these env variables/aliases added to every terminal session?

    Read the article

  • korgac - init.d kill script on shutdown

    - by Max Magnus
    I'm new to Ubuntu 12.04 and Linux and my English is not the best, so I'm sorry for incorrect or stupid questions. I've installed KOrganizer and to start the reminder when I boot the system, I added the korgac command to the autostart. This works fine. But now, every time I want to reboot or shutdown my system, there appears a message that tells me that an unknown process is still running... so I have kill it manually before reboot/shutdown. I knew that it is the korgac process that causes this problem, so I decided to create an init.d script. I've created a script, put it into init.d, and created 2 symbolic links: to rc0.d and to rc6.d. The name starts with K10script... (I hope it is correct so). K10korgac_kill: #! /bin/sh pkill korgac exit 0 Unfortunately this wasn't able to resolve my problem. Maybe my script is wrong. I hope someone can help me. Thanks for your time Max

    Read the article

  • How can I run this script on startup, restart, and shutdown?

    - by Exeleration-G
    I'm using Ubuntu 11.10. I've written a script, that synchronises a directory in ~ with a directory on /dev/sda4, using Unison. Before, I had this script running every five minutes with no problems, using crontab. Right now, I want to execute this script at startup, restart and shutdown only. This is what the script looks like: #!/bin/bash unison -perms 0 -batch "/mnt/Data/Syncfolder/" "/home/myname/Syncfolder/" My crontab configuration was as follows: m h dom mon dow command 0,5,10,15,20,25,30,35,40,45,50,55 * * * * sh /usr/local/bin/s4lj.bash Note that I copied the script from ~ to /usr/local/bin/ first, to avoid root problems. I've read How to execute script on shutdown? and How to write an init script that will execute an existing start script?. After doing that, I've done this: I've made s4lj.bash executable, and then copied it to /etc/init.d/. For startup, I've made a symlink in /etc/rc2.d/ to /etc/init.d/s4lj.bash, and renamed it to S70s4lj.bash. For restart, I've made a symlink in /etc/rc6.d/ to /etc/init.d/s4lj.bash, and renamed it to K70s4lj.bash. For shutdown, I've made a symlink in /etc/rc0.d/ to /etc/init.d/s4lj.bash, and renamed it to K70s4lj.bash. Still, the script won't be run in any of these situations. How can I make the script get executed? I'd be happiest with a proper *.conf file in /etc/init. Thanks in advance.

    Read the article

  • Allow user to SUDO a script without password.

    - by John Isaacks
    I have a php script with this: <?php #echo exec('whoami'); $output = shell_exec('bash /usr/local/svn/bash_repo/make-live'); echo "$output"; ?> The make-live script contains this: #!/bin/bash cd /var/www-cake sudo svn checkout file:///usr/local/svn/bash_repo/repo/ echo "Head revision has been pushed to live server" So the PHP user who is www-data needs to have nopasswd for that script. I am told I need to add: www-data ALL=NOPASSWD: /usr/local/svn/bash_repo/make-live To sudoers to allow this. First I run sudo visudo but I have no experience with vi so I try to open it in gedit with export EDITOR=gedit && sudo -E visudo which then just opens a sudoers.tmp file which is empty. I add the line and save it. But it doesn't do save. So I just try sudo visudo and I add the line right beneath this part: # User privilege specification root ALL=(ALL) ALL www-data ALL=NOPASSWD: /usr/local/svn/bash_repo/make-live I closed out sudoers and reopened to verify that it has saved. I even restart apache. I run the php file and it still doesn't work. What am I missing?

    Read the article

  • Script Task/Component and Template Information

    The Script Task and Script component are often used by people developing SSIS packages because they are easy to use and now because SSIS could be perceived to be more developer friendly they are very powerful. That being said we should no be using them everywhere.  There are generally Tasks/Components already provided that will do the job it may be that we have to rethink the way we want to draw our package. I had cause last week to break out the script component in SQL Server 2008 SP1 and found that it was broken.  I don’t know when it broke as I do not use them all that often.  My error was as below.     Something must have overwritten this template information.  I looked in Event Viewer and tried the things it suggested but the templates still did not work.  Here is how I got them eventually to work for me (Your Mileage may vary) Open up a Command Prompt window using an administrator level account and “as an administrator” vsta.exe /hostid SSIS_ScriptTask /setup vsta.exe /hostid SSIS_ScriptComponent /setup   This worked for me.  Hope it helps.

    Read the article

  • Bash script runs fine, but not in cron

    - by radiotech
    I have a script that's supposed to record a shoutcast stream for an hour, convert it to mp3, and then save it. The script runs correctly when I run it from the terminal, but I can't seem to get it to run in cron (where it should run every hour at the top of the hour). Here's the line in crontab: 0 * * * * /medialib/tech/bin/recordstream 2>&1 >> /medialib/tech/cron.log and here's the script: #!/bin/bash name="$(date +%s)" mp3_name=$name.mp3 wav_name=$name.wav timeout -sHUP 60m vlc -I dummy --sout "#transcode{channels=2}:std{access=file,mux=wav,dst=/medialib/stream_backup/wav/$wav_name" /medialib/tech/lib/listen.m3u lame --mp3input /medialib/stream_backup/wav/$wav_name /medialib/stream_backup/$mp3_name rm /medialib/stream_backup/wav/$wav_name Thank you! EDIT: Contents of cron.log (This text has been in the log file since it was transferred from an old server where it was working). VLC media player 2.0.8 Twoflower Command Line Interface initialized. Type `help' for help. > Shutting down. VLC media player 2.0.8 Twoflower Command Line Interface initialized. Type `help' for help. > Shutting down.

    Read the article

  • Tools for game script / storyboard

    - by Pietro Polsinelli
    I am searching for a tool that will help in writing a game script. By "script" I mean the text core of a storyboard - without the drawing drafts, which may or may not be there (yet). What I'm thinking of will let write a piece of text of the script, define a simplified workflow from that step, and then define the text of next steps, and so on. Searching online, I found Inform http://inform7.com/ ("A Design System for Interactive Fiction Based on Natural Language") which in theory is exactly what I am searching for, but trying to use it it has this model of a space (a dungeon, a library) where you are picking up objects and exploring them. In my case I am designing more a Sims like game, the flow is entirely different. Considering non specific software, mind mapping tools miss the linearity of the process. What I am writing is a directed graph - simply a work-flow, but the way I want to design it is more text based than work-flow based. SO what I'm doing now is using a text editor, which I'll transform directly in code. Any suggestions?

    Read the article

  • How to Generate a Create Table DDL Script Along With Its Related Tables

    - by Compudicted
    Have you ever wondered when creating table diagrams in SQL Server Management Studio (SSMS) how slickly you can add related tables to it by just right-clicking on the interesting table name? Have you also ever needed to script those related tables including the master one? And you discovered you have dozens of related tables? Or may be no SSMS at your disposal? That was me one day. Well, creativity to the rescue! I Binged and Googled around until I found more or less what I wanted, but it was all involving T-SQL, yeah, a long and convoluted CROSS APPLYs, then I saw a PowerShell solution that I quickly adopted to my needs (I am not referencing any particular author because it was a mashup): 1: ########################################################################################################### 2: # Created by: Arthur Zubarev on Oct 14, 2012 # 3: # Synopsys: Generate file containing the root table CREATE (DDL) script along with all its related tables # 4: ########################################################################################################### 5:   6: [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null 7:   8: $RootTableName = "TableName" # The table name, no schema name needed 9:   10: $srv = new-Object Microsoft.SqlServer.Management.Smo.Server("TargetSQLServerName") 11: $conContext = $srv.ConnectionContext 12: $conContext.LoginSecure = $True 13: # In case the integrated security is not used uncomment below 14: #$conContext.Login = "sa" 15: #$conContext.Password = "sapassword" 16: $db = New-Object Microsoft.SqlServer.Management.Smo.Database 17: $db = $srv.Databases.Item("TargetDatabase") 18:   19: $scrp = New-Object Microsoft.SqlServer.Management.Smo.Scripter($srv) 20: $scrp.Options.NoFileGroup = $True 21: $scrp.Options.AppendToFile = $False 22: $scrp.Options.ClusteredIndexes = $False 23: $scrp.Options.DriAll = $False 24: $scrp.Options.ScriptDrops = $False 25: $scrp.Options.IncludeHeaders = $True 26: $scrp.Options.ToFileOnly = $True 27: $scrp.Options.Indexes = $False 28: $scrp.Options.WithDependencies = $True 29: $scrp.Options.FileName = 'C:\TEMP\TargetFileName.SQL' 30:   31: $smoObjects = New-Object Microsoft.SqlServer.Management.Smo.UrnCollection 32: Foreach ($tb in $db.Tables) 33: { 34: Write-Host -foregroundcolor yellow "Table name being processed" $tb.Name 35: 36: If ($tb.IsSystemObject -eq $FALSE -and $tb.Name -eq $RootTableName) # feel free to customize the selection condition 37: { 38: Write-Host -foregroundcolor magenta $tb.Name "table and its related tables added to be scripted." 39: $smoObjects.Add($tb.Urn) 40: } 41: } 42:   43: # The actual act of scripting 44: $sc = $scrp.Script($smoObjects) 45:   46: Write-host -foregroundcolor green $RootTableName "and its related tables have been scripted to the target file." Enjoy!

    Read the article

  • Select (loop) or command not working in shell-script

    - by user208098
    I've been tinkering with Linux and Unix for years but still a novice in my mind and recently find myself trying to be more pro with it as I work in IT. So with that notion I'm studying shell scripting. I've hit a snag in ubuntu using the latest version 13.10 Saucy. When I use the select command in a sh script it doesn't work, depending on how I format the command it will either return Unexpected "do" or Unexpected "done". See the following two examples: This section of code produces an unexpected "do" error: #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit do case $opt in "option1") echo "you chose choice 1" ;; "option2") echo "you chose choice 2" ;; "option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done This section of code produces an unexpected "done" error. #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit ; do case $opt in "Option1") echo "you chose choice 1" ;; "Option2") echo "you chose choice 2" ;; "Option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done When I enter these parameters into the command line interactively or manually I get the desired result which is a list of choices to choose from. However when executed from a script I get the before mentioned errors. Also a side note I have tried this in Fedora as a script and it worked perfectly so my question is why isn't it working in Ubuntu, is this a difference between RHL and Debian? Or is it a bug in the latest version of Ubuntu? Thanks in advance for any help! KG

    Read the article

  • R12 Diagnostic Script for Purchasing Encumbrance Issues

    - by Oracle_EBS
    Do you have a Release 12 Purchasing document with an accounting encumbrance error?  Get all the relevant data in one step using the new diagnostic in DOC ID: 1483743.1 -  ‘R12: Diagnostic Script to help troubleshoot Purchasing Encumbrance Issues’.   Avoid the back and forth pinging with support for data collection.   Query the document id in My Oracle Support and add it to your Favorites using the star icon for quick access. The note includes when to use the script and how to use it.  The script will produce a user friendly html output that contains information relevant to encumbrance issues, along with some data validation checks to identify common data corruption issues on your document.  For example in this one diagnostic it will provide information on the following: Ø Cross Product Setup Ø Document Data Dump Ø Funds availability Ø Subledger accounting information Ø GL and AP Invoice Data Ø Debug and Trace This output is ideal for self service, as it provides known issues in the Data Validation section (related to the document) with links to key documentation.   Or the report can be uploaded to support when logging a Service Request. To see more about the diagnostic, attend our September 11, 2012 Webcast ‘Overview of Procurement Patching and New Tools for Issue Resolution’.  Visit Doc ID 1479718.1 to signup.  Note: This topic will not be listed as it has been just added.

    Read the article

  • Cannot get script to run at startup (tried all the simple answers)

    - by Carey Head
    I have Ubuntu Desktop 12.04 LTS running great on an older Acer desktop. I want to use this machine as an in-home server for hosting Minecraft. The command to start the Minecraft server is java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui and that works great when I cd into the correct directory and execute the above. I created a script to do this: #!/bin/bash cd /home/myuser/minecraft-server1 java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui & cd /home/myuser/minecraft-server2 java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui & exit 0 I made this .sh file executable, and it too runs great when I start it manually from the terminal. The problem I'm having is getting these to execute at startup. I have my user account on this machine to auto login. I have tried the following: Adding the following to "Startup Applications" : sh /home/myuser/myscript.sh (Nothing happens on reboot) Adding the same to /etc/rc.local (Nothing happens on reboot). I even tested this one by running /etc/rc.local from the terminal, and it executed great. Just not at boot/auto login Added the lines from the script directly to rc.local (Nothing happens on reboot). I can't help but think that there's something I'm missing. The script executes great when run manually, but will not run at boot/auto login. Many thanks in advance.

    Read the article

  • Best practice for storing information from a php script for future use

    - by tRudgeF3llow
    My employer uses forms to help people search for products. The product lists can change from time to time and the forms need to be updated again. The product information can be accessed through a third party API which I started tinkering with, I've recently built a script that retrieves the information with PHP and creates and populates a form dynamically with Javascript. So far so good, but... There are limitations to the API, mainly it can only be accessed a certain number of times per hour, it is probably more than my form/script would use but I want to create a script that is minimally intrusive. My main question is... What is the best practice for accessing the information once and storing it long enough to let the API reset? I was wondering about creating a cookie but there is the possibility of users that have them disabled. (Also, I am doing this as a personal project but I like the people I work for and I think this would help them out.) Thanks in advance.

    Read the article

  • Call to daemon in a /etc/init.d script is blocking, not running in background

    - by tony
    I have a Perl script that I want to daemonize. Basically this perl script will read a directory every 30 seconds, read the files that it finds and then process the data. To keep it simple here consider the following Perl script (called synpipe_server, there is a symbolic link of this script in /usr/sbin/) : #!/usr/bin/perl use strict; use warnings; my $continue = 1; $SIG{'TERM'} = sub { $continue = 0; print "Caught TERM signal\n"; }; $SIG{'INT'} = sub { $continue = 0; print "Caught INT signal\n"; }; my $i = 0; while ($continue) { #do stuff print "Hello, I am running " . ++$i . "\n"; sleep 3; } So this script basically prints something every 3 seconds. Then, as I want to daemonize this script, I've also put this bash script (also called synpipe_server) in /etc/init.d/ : #!/bin/bash # synpipe_server : This starts and stops synpipe_server # # chkconfig: 12345 12 88 # description: Monitors all production pipelines # processname: synpipe_server # pidfile: /var/run/synpipe_server.pid # Source function library. . /etc/rc.d/init.d/functions pname="synpipe_server" exe="/usr/sbin/synpipe_server" pidfile="/var/run/${pname}.pid" lockfile="/var/lock/subsys/${pname}" [ -x $exe ] || exit 0 RETVAL=0 start() { echo -n "Starting $pname : " daemon ${exe} RETVAL=$? PID=$! echo [ $RETVAL -eq 0 ] && touch ${lockfile} echo $PID > ${pidfile} } stop() { echo -n "Shutting down $pname : " killproc ${exe} RETVAL=$? echo if [ $RETVAL -eq 0 ]; then rm -f ${lockfile} rm -f ${pidfile} fi } restart() { echo -n "Restarting $pname : " stop sleep 2 start } case "$1" in start) start ;; stop) stop ;; status) status ${pname} ;; restart) restart ;; *) echo "Usage: $0 {start|stop|status|restart}" ;; esac exit 0 So, (if I have well understood the doc for daemon) the Perl script should run in the background and the output should be redirected to /dev/null if I execute : service synpipe_server start But here is what I get instead : [root@master init.d]# service synpipe_server start Starting synpipe_server : Hello, I am running 1 Hello, I am running 2 Hello, I am running 3 Hello, I am running 4 Caught INT signal [ OK ] [root@master init.d]# So it starts the Perl script but runs it without detaching it from the current terminal session, and I can see the output printed in my console ... which is not really what I was expecting. Moreover, the PID file is empty (or with a line feed only, no pid returned by daemon). Does anyone have any idea of what I am doing wrong ? EDIT : maybe I should say that I am on a Red Hat machine. Scientific Linux SL release 5.4 (Boron) Would it do the job if instead of using the daemon function, I use something like : nohup ${exe} >/dev/null 2>&1 & in the init script ?

    Read the article

  • Cannot open simple script application on mac

    - by streetpc
    Mac OS X 10.6 I created a very simple app, which is only a wrapper of a shell script (so that I can select this script in application selectors, like startup apps). I try to launch it and yesterday it worked, but today I changed the executable script's content and name (with something that perfeclty works in a shell script launched in the Terminal) and it will only display a Finder-iconed dialog saying Cannot open the application because it is not supported on this kind of Mac. I restored the previous script (content/name) but I still get the error! Same when re-bundling the app from scratch, or completely changing the bundle identifier… If I try to open it in the Terminal using open My.app, I get The application cannot be opened because it has an incorrect executable format. But when I executes directly the Contents/MacOS/Script, it allways works (iwth both contents). Also, it is displayed with correct icon and meta-information in the Finder (so I guess the Info.plist is understood). The app's file tree is: Contents/ Info.plist MacOS/ Script (executable bit set, works when launched directly) PkgInfo Resources/ AppIcon.icns Here is the Info.plist content: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleExecutable</key> <string>Script</string> <key>CFBundleIconFile</key> <string>AppIcon</string> <key>CFBundleIdentifier</key> <string>asdf.ScriptApp</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>My script</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>LSMinimumSystemVersion</key> <string>10.4</string> </dict> </plist> And the PkgInfo file only contains APPL????. I tested the Script with a simple echo "ok" and echo "ok" >/tmp/test (plus #!/bin/sh header). So my questions are: Is there some kind of validity caching for applications ? based on what ? how do I flush it ? Where does this message come from ? I tried to google it but all I get is a page talking about 32/64 bits Java…

    Read the article

  • Cannot open simplest script mac application

    - by streetpc
    I created a very simple app, which is only a wrapper of a shell script (so that I can select this script in application selectors, like startup apps). I try to launch it and yesterday it worked, but today I changed the executable script's content and name (with something that perfeclty works in a shell script launched in the Terminal) and it will only display a Finder-iconed dialog saying Cannot open the application because it is not supported on this kind of Mac. I restored the previous script (content/name) but I still get the error! Same when re-bundling the app from scratch, or completely changing the bundle identifier… If I try to open it in the Terminal using open My.app, I get The application cannot be opened because it has an incorrect executable format. But when I executes directly the Contents/MacOS/Script, it allways works (iwth both contents). Also, it is displayed with correct icon and meta-information in the Finder (so I guess the Info.plist is understood). The app's file tree is: Contents/ Info.plist MacOS/ Script (executable bit set, works when launched directly) PkgInfo Resources/ AppIcon.icns Here is the Info.plist content: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleExecutable</key> <string>Script</string> <key>CFBundleIconFile</key> <string>AppIcon</string> <key>CFBundleIdentifier</key> <string>asdf.ScriptApp</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>My script</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>LSMinimumSystemVersion</key> <string>10.4</string> </dict> </plist> And the PkgInfo file only contains APPL????. I tested the Script with a simple echo "ok" and echo "ok" >/tmp/test (plus #!/bin/sh header). So my questions are: Is there some kind of validity caching for applications ? based on what ? how do I flush it ? Where does this message come from ? I tried to google it but all I get is a page talking about 32/64 bits Java…

    Read the article

  • Handle filename with spaces inside Bash-script

    - by ifischer
    In my Bash-script i have to handle filenames with spaces. These are the important lines inside my script: mp3file="/media/d/Music/zz_Hardcore/Sampler/Punk-O-Rama\ Vol.5\ \[MP3PRO\]/01\ -\ Nofx\ -\ Pump\ up\ the\ Valium.mp3" echo "Command: mp3info -x `echo $mp3file`" mp3info -x `echo $mp3file` Unfortunately, the command does not work, because the filename is splitted: mp3info: invalid option -- '\' mp3info: invalid option -- '\' Error opening MP3: /media/d/Music/zz_Hardcore/Sampler/Punk-O-Rama\: No such file or directory Error opening MP3: Vol.5\: No such file or directory Error opening MP3: \[MP3PRO\]/01\: No such file or directory Error opening MP3: Nofx\: No such file or directory Error opening MP3: Pump\: No such file or directory Error opening MP3: up\: No such file or directory Error opening MP3: the\: No such file or directory Error opening MP3: Valium.mp3: No such file or directory I also tried to add a custom IFS as i read on some forums: SAVEIFS=$IFS IFS=$(echo -en "\n\b") # Script like above IFS=$SAVEIFS But this way, i'm getting the error Error opening MP3: /media/d/Music/zz_Hardcore/Sampler/Punk-O-Rama\ Vol.5\ \[MP3PRO\]/01\ -\ Nofx\ -\ Pump\ up\ the\ Valium.mp3: No such file or directory I tried quite a while now but i cannot get my script to work. What is strange is that if i'm running the same command that my script should create manually (echoing it inside my script) on the Shell, it actually works. But not inside my script. Any hints?

    Read the article

  • Installing MySQL on Ubuntu Natty with Shell Script

    - by Obi Hill
    I'm trying to install MySQL on Ubuntu Natty from a shell script. However, I keep running into one major issue: when I try to define the password outside of the shell script. Below is the code to my shell script (which I have saved in /etc/init.d/install_mysql: export DEBIAN_FRONTEND=noninteractive echo mysql-server-5.1 mysql-server/root_password password $dbpass | debconf-set-selections echo mysql-server-5.1 mysql-server/root_password_again password $dbpass | debconf-set-selections apt-get -y install mysql-server So what I enter in the terminal is: dbpass="mysqlpass" chmod +x /etc/init.d/install_mysql /etc/init.d/install_mysql MySQL installs, but it installs without a password, so I can just do something like mysql -uroot to access mysql (which I don't want). The funny thing is if I put the password in the shell script as regular text, it works ok. So if I my install script is as follows, everything works (i.e. I must specify a password to access mysql): export DEBIAN_FRONTEND=noninteractive echo mysql-server-5.1 mysql-server/root_password password mysqlpass | debconf-set-selections echo mysql-server-5.1 mysql-server/root_password_again password mysqlpass | debconf-set-selections apt-get -y install mysql-server Is there a way I can use a shell script variable to define my password in the shell script, instead of entering the password literally?! Thanks in advance. EDIT I've found the answer to this. The following is what I should have entered in the terminal: dbpass="mysqlpass" export dbpass chmod +x /etc/init.d/install_mysql /etc/init.d/install_mysql It works like a charm now.

    Read the article

  • What about Programmer "Invisible" registers?

    - by claws
    These are "Programmer Visible" x86-64 registers: What about the invisible registers? Just now I learned that MMU registers, Interrupt Descriptor Table (IDT) uses these invisible registers. I'm learning these things in the hard way. Is there any resource (book/documentation/etc) that gives me the complete picture at once? I am aware of the programmer visible registers and comfortable in programming with them. I just want to learn about invisible registers and their functionality. I want to get a complete picture. Where can I get this info?

    Read the article

  • When running PowerShell script as a scheduled task some Exchange 2010 database properties are null

    - by barophobia
    Hello, I've written a script that intends to retrieve the DatabaseSize of a database from Exchange 2010. I created a new AD user for this script to run under as a scheduled task. I gave this user admin rights to the Exchange Organization (as a last resort during my testing) and local admin rights on the Exchange machine. When I run this script manually by starting powershell (with runas /noprofile /user:domain\user powershell) everything works fine. All the database properties are available. When I run the script as a scheduled task a lot of the properties are null including the one I want: DatabaseSize. I've also tried running the script as the domain admin account with the same results. There must be something different in the two contexts but I can't figure out what it is. My script: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "Starting script" $databases = get-mailboxdatabase -status if($databases -ne $null) { Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "Object created" $databasesize_text = $databases.databasesize.tomb().tostring() if($databasesize_text -ne $null) { $output = "echo "+$databasesize_text+":ok" Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "Path check" if(test-path "\\mon-01\prtgsensors\EXE\") { Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "Path valid" Set-Content \\mon-01\prtgsensors\EXE\ex-05_db_size.bat -value $output } Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "Exiting program" } else { Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "databasesize_text is empty. nothing to do" } } else { Write-EventLog 'Windows PowerShell' -source PowerShell -eventid 100 -message "object not created. nothing to do" } exit 0

    Read the article

  • Sharepoint Workflow "Failed on Start" only when powershell import script is called from task scheduler

    - by Matt Keller
    I created a simple PowerShell script that takes an XML file in a local directory on our sharepoint server and imports it into a specific SharePoint form library. (Content management enabled library if that makes any difference) This script works flawlessly if i run it from the PowerShell command line manually. I call it like such: ".\script_name.ps1". It completes without error and the item is imported into the form library successfully. The workflow begins on the item and everything is happy dandy. However, i run into issues when i setup a scheduled task using Windows Server 2008 R2's task manager. The task runs the script without error and it does actually import the XML into the form library. I looks perfectly normal just as if i had run the script manually. However, after about 10 or 20 minutes the workflow status for that item changes from "In progress" to "Failed on Start (Retrying)". The scheduled task in question is a basic task and has only one action. (Start a program) The "program/script" box is set to "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" and the "Add arguments" box is set to the path of the actual ps1 script. (C:\scripts\sharepoint_import.ps1) I've tried running the task as various users. I've also tried with and without the "Run with highest privileges" check box. Nothing seems to work. For reference, here is the script i am using to import items into the form library.

    Read the article

  • How to send a signal SIGINT from script to script ? BASH

    - by debugger
    I want to trap a signal send from Script-A.sh to Script-B.sh so in Script-A.sh i use the command (Send SIGINT to Script-B.sh) kill -2 $PID_Script-B.sh And in Script-B.sh i catch the signal and call function Clean trap 'Clean' 2 It does not work, instead the Script-B.sh is killed right away without performing the Clean !! What i notice also is that if i want to send SIGINT from terminal to any script that traps it, a ctrl-c will be catched correctly, but not if i specify the signal via the command kill -2 $pid_of_script Any idea about the difference between the two method to send the SIGINT (ctrl-c VS kill -2 $pid_of_script), and how i can send a SIGINT from a script to another ? Regards, Debugger

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >