Search Results

Search found 22267 results on 891 pages for 'script'.

Page 4/891 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • export command within shell script

    - by shantanuo
    When I use export command at command prompt, it works as expected. But it does not work from shell script. [root@server shantanu]# export myip=10 [root@server shantanu]# echo $myip 10 [root@server shantanu]# vi myip.sh #!/bin/sh export myipadd=10 [root@server shantanu]# sh -xv myip.sh #!/bin/sh export myipadd=10 + export myipadd=10 + myipadd=10 [root@server shantanu]# echo $myipadd I want to make the variable available to the same script next time when it runs. In other words I am looking for some way to memorize the variable value.

    Read the article

  • svn path in google apps script

    - by deepasun
    Hi, I want to write a google apps script in google docs spreadsheet, such that it should update the svn revision of particular component automatically (which is in one cell of that spreadsheet) when i run that script

    Read the article

  • Script to wrap around an application and wait for app to finish

    - by JohnyV
    I need a vb script that will wrap around an applcation which will stay open until the application finishes. I want to be able to call the following command "setup.exe /qb /I Autocad2010.ini /language en-us" But I need the vb script to stay running until the setup has finished. Is there anyone out there that can assist with this. Much appreciated in advance

    Read the article

  • Batch Script to restart service

    - by saikishore
    Can anyone help with a peice of batch script to restart an application service at scheduled time. For example: If the service is "windows firewall " Then the script should restart this service every day at 09:00 AM and 09:00PM . Can someone help with complete code.(Assume that there is no dependency of this service on any other service).Any help is greately appreciated. Thanks Harry

    Read the article

  • Problems with Startup after Script runs to Shutdown Windows 7 PC

    - by Toby Allen
    I have a simple .bat script to shutdown a kiosk style machine in our work shutdown -h -f this hibernates the machine and I have it running each evening as a scheduled job. However my problem comes when I turn the machine on again. The first time I press power it starts up and then immediately hibernates again, like it runs the script a second time. the second time I press power it stays up. Any suggestions on how I can avoid this?

    Read the article

  • Solaris: a simple script does not work, single command does

    - by CSG
    In my Solaris Illumos, I run a simple script: update_drv -a -i '[myhardware]' [driver] svcadm disable stmf svccfg import /mypath/myconfig svcadm enable stmf It does not work and gives me no error. The service stmf goes in maintenance mode and I must reboot! I've discovered that if I run the single commands from console, it works but if I put it into a script, it works only the first line. Can you explain this behavior?

    Read the article

  • How to add a startup/shutdown script to the GPO from the command line

    - by thomasjames
    I need to add startup and shutdown scripts from a CLI through a Powershell/Python/CMD script. Ideally, I would like to have the same functionality as gpedit.msc, but it is important that the tasks of adding and removing such scripts do not require user interaction and can be done entirely within the context of a script. Currently, the scripts here seem to be in the same category, but none of them explicitly address editing startup and shutdown scripts: http://msdn.microsoft.com/en-us/library/aa814151(v=vs.85).aspx Let me know if anyone has any ideas and thanks in advance.

    Read the article

  • Problem with running a script at startup as root?

    - by Usman Ajmal
    Hi The main question: Is there a way I can run 'completely' one of my script when ubuntu's desktop appears no matter if root , administrator, desktop user or an unprivileged user logged in? What does the script do? The script mounts a partition, looks for a file in that partition and finally on the basis of that file a decision of copying a partition to another partition is made. That copying is done via dd if=/dev/sda2 of=/dev/sda5 When does the script run finely? Script runs smoothly when I run it from the terminal by sudo ./my_copying_script This command asks me for the password of currently logged in user. I enter the password and the script starts working. When does the script NOT run finely? I want to run the script at startup. I set it a startup program by using the Startup Applications utility of Ubuntu. Script ran at startup but exited at the dd command returing following error: dd: opening '/dev/sda2': Permission denied On edk's suggestion I set the owner of my_copying_script as root and set the SUID. Now the permissions of my_copying_script are (-rwsr-sr-x). edk's point of view was that once I set the suid, the startup program will run with the permissions of its owner. I did that but the same /dev/sda2 permission denied error came up. I then prefixed the dd with sudo as mentioned below sudo dd if=/dev/sda2 of=/dev/sda5 but this returned following error: sudo: no tty present and no askpass program specified In other words the mounting failed. If I run the script using sudo ./myProgram i don't face this problem and the drive gets mounted successfully.

    Read the article

  • webbrowser disable script debugging in Visual Basic 6

    - by me4245
    Hi, I want to disable script errors from popping up in a VB6 application. (I have VB6 installed on this machine). Currently, if I navigate to a particular page, it pops up saying "INternet Explorer Script Error: An error has ocurred in the script on this page" ... "Do you want to continue running scripts on this page?" Setting the webbrowser1.silent to 'true' does not work. Instead all that happens, is instead of displaying an error message, it starts up the actual 'script' debugger, and then exits the program. On a machine without the (visual studio) debugger, it still pops up a message asking to use the debugger, i.e., on Vista, (when silent is set to true). Manually changing the 'disable script debugging (other)' (and regular one), doesn't seem to working in MSIE (also testing version 6.0 for xp users). How do I disable script errors? Thanks in advance!

    Read the article

  • php script dies when it calls a bash script, maybe a problem of server configuration

    - by user347501
    Hi!!! I have some problems with a PHP script that calls a Bash script.... in the PHP script is uploaded a XML file, then the PHP script calls a Bash script that cut the file in portions (for example, is uploaded a XML file of 30,000 lines, so the Bash script cut the file in portions of 10,000 lines, so it will be 3 files of 10,000 each one) The file is uploaded, the Bash script cut the lines, but when the Bash script returns to the PHP script, the PHP script dies, & I dont know why... I tested the script in another server and it works fine... I dont believe that is a memory problem, maybe it is a processor problem, I dont know, I dont know what to do, what can I do??? (Im using the function shell_exec in PHP to call the Bash script) The error only happens if the XML file has more than 8,000 lines, but if the file has less then 8,000 everything is ok (this is relative, it depends of the amount of data, of strings, of letters that contains each line) what can you suggest me??? (sorry for my bad english, I have to practice a lot xD) I leave the code here PHP script (at the end, after the ?, there is html & javascript code, but it doesnt appear, only the javascript code... basically the html is only to upload the file) " . date('c') . ": $str"; $file = fopen("uploadxmltest.debug.txt","a"); fwrite($file,date('c') . ": $str\n"); fclose($file); } try{ if(is_uploaded_file($_FILES['tfile']['tmp_name'])){ debug("step 1: the file was uploaded"); $norg=date('y-m-d')."_".md5(microtime()); $nfle="testfiles/$norg.xml"; $ndir="testfiles/$norg"; $ndir2="testfiles/$norg"; if(move_uploaded_file($_FILES['tfile']['tmp_name'],"$nfle")){ debug("step 2: the file was moved to the directory"); debug("memory_get_usage(): " . memory_get_usage()); debug("memory_get_usage(true): " . memory_get_usage(true)); debug("memory_get_peak_usage(): " . memory_get_peak_usage()); debug("memory_get_peak_usage(true): " . memory_get_peak_usage(true)); $shll=shell_exec("./crm_cutfile_v2.sh \"$nfle\" \"$ndir\" \"$norg\" "); debug("result: $shll"); debug("memory_get_usage(): " . memory_get_usage()); debug("memory_get_usage(true): " . memory_get_usage(true)); debug("memory_get_peak_usage(): " . memory_get_peak_usage()); debug("memory_get_peak_usage(true): " . memory_get_peak_usage(true)); debug("step 3: the file was cutted. END"); } else{ debug("ERROR: I didnt move the file"); exit(); } } else{ debug("ERROR: I didnt upload the file"); //exit(); } } catch(Exception $e){ debug("Exception: " . $e-getMessage()); exit(); } ? Test function uploadFile(){ alert("start"); if(document.test.tfile.value==""){ alert("First you have to upload a file"); } else{ document.test.submit(); } } Bash script with AWK #!/bin/bash #For single messages (one message per contact) function cutfile(){ lines=$( cat "$1" | awk 'END {print NR}' ) fline="$4"; if [ -d "$2" ]; then exsts=1 else mkdir "$2" fi cp "$1" "$2/datasource.xml" cd "$2" i=1 contfile=1 while [ $i -le $lines ] do currentline=$( cat "datasource.xml" | awk -v fl=$i 'NR==fl {print $0}' ) #creates first file if [ $i -eq 1 ]; then echo "$fline" "$3_1.txt" else #creates the rest of files when there are more than 10,000 contacts rsd=$(( ( $i - 2 ) % 10000 )) if [ $rsd -eq 0 ]; then echo "" "$3_$contfile.txt" contfile=$(( $contfile + 1 )) echo "$fline" "$3_$contfile.txt" fi fi echo "$currentline" "$3_$contfile.txt" i=$(( $i + 1 )) done echo "" "$3_$contfile.txt" return 1 } #For multiple messages (one message for all contacts) function cutfile_multi(){ return 1 } cutfile "$1" "$2" "$3" "$4" echo 1 thanks!!!!! =D

    Read the article

  • Photoshop CS5 not recognising activeDocument

    - by Max Kielland
    I wrote a quite big script for Photoshop CS5.1 on my 64bit Vista machine. Now when I run the very same script on my new 64bit Windows 7 machine, Adobe ExtendScript Tool complains about activeDocument (no such element) in this simple script: #target photoshop var pDoc = app.activeDocument; alert("Done!"); I have tried both and without #target and choosing the target in the ExtendedScript Tool. Is there something I have missed, or do I need to install something more. I only installed the 64bit version of Photoshop. Is it so that the 32bit Photoshop has the script extensions? I don't see why I need to install both 32bit and 64bit versions if I'm only going to use the 64bit version. EDIT I installed the 32bit version as well. Tried the same script against 32 and 64 bit, still no difference. SOLVED The mystery is solved. It is embarrassing simple if you interpret the error message more careful. Of course I can't get an activeDocument if there are no documents in Photoshop, duh!?! I interpreted it as the statement activeDocument wasn't recognised, but of course if I have no document there is no such element (as a photoshop document) to give me. I'm used to C++ and would expect the reuslt to be a NULL value or similar if there is a problem to get the document... excuses, excuses ;) Well, if someone else should get into the same problem, here is the answer on my expense :D

    Read the article

  • rm failing inside cron script

    - by Nicholas
    I have a cron job calling a bash script which runs fine, except for one line inside it that is suppose to remove all fines in a directory. The result of this line is always 'no such file or directory' even though I have verified (many times) that there are files in that directory. The line in question is as simply: rm /dir1/dir2/dir3/* The script works fine when run manually in the terminal, so it must be something about how the cron is run. I've tried giving 'dir3' and all the files inside it every permission possible, so it shouldn't be a permission problem. (The directory and files are also owned by the user). I've tried specifing 'SHELL=/bin/bash' inside 'crontab'. There is no sticky bit set and there is no alias on the rm command. Interestingly changing the 'rm' command to 'ls' gives the same negative result (unless you remove the trailing '*', and then that works). What am I missing here?

    Read the article

  • How to run adb command through a script

    - by Outride
    As the title says, I'm trying to find how to run adb commands through a pre-written script (such as how .bat and .vbs files work) so I can make a semi automatic program to pull some files from my android phone whenever I click on the launch.bat which launches a line of program to go through the phone and find certain files. I know the script line: adb pull /data/data/kik.android/databases/ %drive%\All\Database This copies all the files in this specific database into the flash drive's folder "Database" under the "All" folder. But, how could i make it so that the adb program looks through the phone and finds other files, and how could i pull the specific files, rather than pulling the entire folder?

    Read the article

  • wait for the second VB script untill ended from primary VB script

    - by yael
    Hi I have VB script that run second VB script The second VB script ask some questions from the input box My problem is that “MyShell.Run” not wait until SecondVBscript.vbs will ended And the Other VB syntax run immodestly also Need to wait for MyShell.Run process ended and then perform the Other VB syntax How can I do that? Set MyShell = Wscript.CreateObject("WScript.Shell") MyShell.Run " C:\Program Files\SecondVBscript.vbs" Set MyShell = Nothing Other VB syntax

    Read the article

  • sudo displays typed password in bash script

    - by Andy
    Hullo, I have a bash script that uses sudo a few times. There's a couple of strange points about it though. It asks me for my password a few seconds after I've already entered it for a previous command. The second time I enter my password, it's echoed to the display. Here's the relevant bits of the script. sudo service apache2 stop drush sql-dump --root="$SITE_DIR" --structure-tables-key=svn --ordered-dump | grep -iv 'dump completed on' | sudo tee "$DB_DIR/${SITE_NAME}.sql" > /dev/null sudo svn diff "$DB_DIR" | less sudo svn commit -m "$MESSAGE" "$DB_DIR" sudo service apache2 start The first password is to stop apache, and it works as expected. As mentioned, the sudo tee doesn't 'remember' that I have elevated privileges, asks for the password again, and echoes it to the screen. Given that tee is all about echoing to screen, I've played around a little with simple scripts which have | sudo tee, and they all work as expected. Ideas?! TIA Andy

    Read the article

  • Shell script with ImageMagick: hangs forever?

    - by AP257
    I've generated a shell script that uses ImageMagick to convert and crop around 18000 images. Here's a sample entry (so there are 18000 of these): if [ ! -f ./cropped/16333-1.png ] then convert -crop 724x118+876+1989 ./lin/34.png ./cropped/16333-1.png echo cropping 16333-1 fi if [ ! -f ./cropped/16333-1_thumb.png ] then convert -define jpeg:size=400x100 ./cropped/16333-1.png -thumbnail '400x100>' -background transparent -gravity center -extent 400x100 ./cropped/16333-1_thumb.png echo thumbing 16333-1 fi The script only runs for about 2000 images before hanging forever. Am I missing something, or leaking memory somewhere? Thanks for your help!

    Read the article

  • How to remove blank lines in .txt file

    - by Brant
    I want to change text file format as following , but don't know how to do (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change high pressure refrigerant vapour to liquid c) pressurise low pressure refrigerant vapour d) vent off vapourised refrigerant e) lower the liquid refrigerant pressure (2) 6. One tonne of refrigeration is: a) 13958 kJ per day b) 100 kJ per minute c) 233 kJ per minute d) 13958 J per hour e) 335 J per second (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change high pressure refrigerant vapour to liquid c) pressurise low pressure refrigerant vapour d) vent off vapourised refrigerant e) lower the liquid refrigerant pressure (2) 6. One tonne of refrigeration is: a) 13958 kJ per day b) 100 kJ per minute c) 233 kJ per minute d) 13958 J per hour e) 335 J per second

    Read the article

  • cannot run CMD script from Vista windows explorer

    - by jamesvista
    I am running Vista Home Premium. I tried to write a script to do some simple automation.... it does not work! even the most simple script like: @echo ON dir . does not get executed and only an empty CMD shell pops open when started from explorer. From the cmd windows there is no problem. This is really weird and I have never seen this before (but wrote many CMD scripts before) ftype cmdfile and batfile are unchanged from "%1" %* virusscan done - no problems Is there a policy setting that might have changed? Any ideas?

    Read the article

  • Shell Script, iterating over a folder

    - by Martin
    I have very basic shell scripting knowledge. I have photos under original folder on many different folder like this folder + folder1 + original + folder2 + original + folder3 + original + folder4 + original Using mogrify I'm trying to create thumbs under a thumb folder following a structure to this. folder + folder1 + original + thumb + folder2 + original + thumb + folder3 + original + thumb + folder4 + original + thumb I'm a little lost in how to write the shell script that may iterate through it. I'm ok giving mogrify its settings but I don't complete understand how to tell the script to go iterate each folder to run the mogrify command.

    Read the article

  • cannot run CMD script from Vista windows explorer

    - by jamesvista
    I am running Vista Home Premium. I tried to write a script to do some simple automation.... it does not work! even the most simple script like: @echo ON dir . does not get executed and only an empty CMD shell pops open when started from explorer. From the cmd windows there is no problem. This is really weird and I have never seen this before (but wrote many CMD scripts before) ftype cmdfile and batfile are unchanged from "%1" %* virusscan done - no problems Is there a policy setting that might have changed? Any ideas?

    Read the article

  • Server speed: sharing one script.php or using many copies the same script.php

    - by Marco Demaio
    Let's assume: I have thousands of domains on same Apache server. Each domain is in a folder under server public_html document folder, so it can be accessed by calling "www.somedomain.com" or by calling "www.serverdomain.com/somedomain_folder" In each domain there is a website who needs a certain script.php (identical for each domain). From a coding point view, its obvious that it's better to use a unique script.php, so when i update it with new features/bug fixes etc, I need to update on server only one file and it will work for all domains. But from a server point of view? If i use a unique script all domains will access it at the same time, will the server run slower compared to the situation where each domain called its own script?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >