Search Results

Search found 33940 results on 1358 pages for 'line numbers'.

Page 15/1358 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Running a command line app with sudo and password automatically on OS X startup

    - by Designer023
    I need to run an app at startup/login on my mac. I want it to launch in the background and start doing it's work without interrupting me or me having to start it up because I invariably forget and then when I need it, it wasn't running! I have tried using AppleScript to tell Terminal to run it and type my password in, but it ends up opening multiple Terminal windows and not working. Ideally I need a script that I can just add to the user login items and it will run for me. The app has no way of taking a password argument either and it has a password as well as the sudo! I need a solution that can either be done as an applescript (which can be made into an executable) or i need a commandline script but I have no idea about them. This is the manual code I type $ sudo serverStatus password:123456 password:serverpass My AppleScript: tell application Terminal activate do shell script "sudo serverStatus" delay 5 do shell script "123456" delay 2 do shell script "serverpass" end tell

    Read the article

  • Copy file to WebDAV via Command Line on Windows 2003

    - by Boden
    I need to copy a file from a Windows 2003 server to a WebDAV folder (on the same server, if it matters). This operation will be performed via a batch script executed via Scheduled Tasks. I've enabled the WebClient service on the server. So far I've determined that I can do it like this: net use x: http://host/path copy c:\path\myfile.txt x: net use x: /delete 1) Is there a simpler way than creating a temporary mapped drive? Will it work via a batch file when no user is logged in? 2) Is there anything I should know about enabling the WebClient service on my server? Previously it was disabled, which I assume is default.

    Read the article

  • running more than one command line commands inside for loop

    - by klijo
    i have a folder containing images and i want to determine its Compression method used. So i would loop through the folder and do a grep Compression like this and note i have installed grep for windows for %f in (*.jpg) do identify -verbose "%f" | grep Compression >> info.txt However i need to write the file name and compression technique used so i modified the above command for %f in (*.jpg) do identify -verbose "%f" | grep Compression & echo "%f" & echo: >> info.txt But the problem is that i get a blank txt file. Could someone pleas help me.

    Read the article

  • Command line switching

    - by Larry
    I have read through some suggestions but I am just not technical enough to get this I think. I am a CAD designer and each file has 5 files associated with it. I have 3 sets of 5 files, and each set needs to go into its own zip file, placed on a separate server. For example: "C:\Program Files\7-zip\7z.exe" a file1.zip "O:\server2\map files\BC\BC.d*"-0 "C:\Program Files\7-zip\7z.exe" a file2.zip "O:\server2\map files\BC\ON.d*"-0 "C:\Program Files\7-zip\7z.exe" a file3.zip "O:\server2\map files\BC\AB.d*"-0 and I am in directory "S:\server\map files\provinces" (for example). These lines run within an existing batch file and by the time it reaches the 3 lines above, it's in the S: directory sample above. So it's looking on my pc for the 7-zip program, creating 3 zip file names which it does, but places those zip files on a separate server which it doesn't and the first zip file also includes all the other 10 files, the second zip file the same plus the first zip file, and the third the same with the other two zip files making me think the code isn't recognizing the part after file1.zip where I am trying to tell it what files to include and where to place the zip files. Ultimately, I want to either have the system create a new zip file if the old one was deleted, or copy the new files into the existing zip and overwrite any older files, and for these zip files to be placed in a separate location which is where we share our files with other personnel from within our company. The S: drive is for all originals, and O: is for sharing. Is there a list of all switching options with many different samples?

    Read the article

  • Simple command line calculator

    - by ldigas
    Had one years ago (on Win 3.1 or '95, I'm not sure). Anyways, it was a really simple program. Stood somewhere in PATH and enabled you to do something of a kind calc 5 + 28.3*sqrt(12) and it spit out the result. Anyone know of any such these days? Doesn't need to do anything fancy ... maybe it would just be nice if it had support for exponentials, but that's it. Anyone? p.s. Not interested in full blown solutions like Python or MATLAB.

    Read the article

  • Fake demostration software for command line

    - by Joe
    I'm looking for some software that would be useful for giving demonstrations. I regularly have to show the effects of scrips ect to classes while talking about their effects, and equaly regularly I have finger trouble and have to rewrite various commands - wasting class time and general energy. I'd like to be able to record a sequence of commands in advance, and then play them back at the speed of my choosing. So I might have a file that containes the commands: echo "hello world!" ls ls -l ls -l | sort I'd like to be able to play these commands back by typing similar ones in. So I'd have a blinking command prompt and if I typed 'echo "hxxx' the command prompt would read home$echo "hell and if I typed any other letters the terminal would fill up with the remainder of the command until I press enter, when it executes the command. The point is that even if I screw up the command when typing it, the command that I'd prepared in advance would be executed. My question is - does similar software exist for giving demonstrations? or even, is this an easy thing to script up...? EDIT - two quick things first of all I'm on osx - but it would be nice to get a general solution for other people who arrive here from google. and second a lot of the comments/answers are concentrating on, in effect, making it fast and easy to enter long commands by means of hotkeys and the like. Actually I'd like it to at least look like I'm typing live - that's why I put in the bit about the one-to-one keymapping, but I don't think I explained that quite as well as I could have...

    Read the article

  • running a command line app with sudo and password automatically on start up OS X (Lion)

    - by Designer023
    I need to run an app at startup/login on my mac. I want it to launch in the background and start doing it's work without interrupting me or me having to start it up because I invariably forget and then when I need it, it wasn't running! I have tried using applescript to tell terminal to run it and type my password in, but it ends up opening multiple Terminal windows and not working. Ideally I need a script that I can just add to the user login items and it will run for me. The app has no way of taking a password argument either and it has a password as well as the sudo! I need a solution that can either be done as an applescript (which can be made into an executable) or i need a commandline script but I have no idea about them. This is the manual code I type >sudo serverStatus >password:123456 >password:serverpass Not sure if this is the right stack to ask, but I have no idea now and it's above my head! Thanks :D My applescript: tell application Terminal activate do shell script "sudo serverStatus" delay 5 do shell script "123456" delay 2 do shell script "serverpass" end tell

    Read the article

  • Delete last 3 lines within while ((line = r.ReadLine()) != null) but not open a new text file to delete the lines?

    - by user1473672
    This is the code I've seen so far to delete last 3 lines in a text file, but it's required to determine string[] lines = File.ReadAllLines(); which is nt necessary for me to do so. string[] lines = File.ReadAllLines(@"C:\\Users.txt"); StringBuilder sb = new StringBuilder(); int count = lines.Length - 3; // except last 3 lines for (int s = 0; s < count; s++) { sb.AppendLine(lines[s]); } The code works well, but I don't wanna re-read the file as I've mentioned the streamreader above : using (StreamReader r = new StreamReader(@"C:\\Users.txt")) Im new to C#, as far as I know, after using streamreader, and if I wanna modify the lines, I have to use this : while ((line = r.ReadLine()) != null) { #sample codes inside the bracket line = line.Replace("|", ""); line = line.Replace("MY30", ""); line = line.Replace("E", ""); } So, is there any way to delete the last 3 lines in the file within the "while ((line = r.ReadLine()) != null)" ?? I have to delete lines, replace lines and a few more modications in one shot, so I can't keep opening/reading the same text file again and again to modify the lines. I hope the way I ask is understable for you guys .< Plz help me, I know the question sounds simple but I've searched so many ways to solve it but failed =( So far, my code is : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace ConsoleApplication11 { public class Read { static void Main(string[] args) { string tempFile = Path.GetTempFileName(); using (StreamReader r = new StreamReader(@"C:\\Users\SAP Report.txt")) { using (StreamWriter sw = new StreamWrite (@"C:\\Users\output2.txt")) { string line; while ((line = r.ReadLine()) != null) { line = line.Replace("|", ""); line = line.Replace("MY30", ""); line = line.Replace("E", ""); line = System.Text.RegularExpressions.Regex.Replace(line, @"\s{2,}", " "); sw.WriteLine(line); } } } } } } Now my next task is to delete the last 3 lines in the file after these codes, and I need help on this one. Thank you.

    Read the article

  • Reading line by line from a file in C

    - by mh234
    What I am trying to do is print out the contents of a file line by line. I run the program in terminal by doing: ./test testText.txt. When I do this, random characters are printed out but not what is in the file. The text file is located in the same folder as the makefile. What's wrong? #include <stdio.h> FILE *fp; int main(int argc, char *argv[]) { char line[15]; fp = fopen(*argv, "r"); while((fgets(line, 15, fp)) != NULL) { printf(line); printf("\n"); } }

    Read the article

  • How do I enable the "Universe" repository from the command line?

    - by Kangarooo
    How do you use terminal to enable Universe source? Or any those 4 from Software Sources: Main, Universe, Restricted, Multiverse Main is on by default and Restricted is on if durring Ubuntu installation i tick Enable Restricted Formats. Answer with line where version checked so it auto detects it. Like command I know for partner but that goes to Other Software tab sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"

    Read the article

  • How do I disable Caps Lock by command line?

    - by Echogene
    For some reason my laptop is stuck in Caps Lock. I have the Caps Lock key mapped by xmodmap to hyper_l, so I don't have a caps_lock key to turn it off. Is there a way I can turn it off by command line? It would be nice if I could reset the lock state without resetting my computer, especially for future reference. This has happened before, but I would like to know now how to do it properly this time.

    Read the article

  • C/C++ line number

    - by Betamoo
    In the sake of debugging purposes, can I get the line number in C/C++ compilers? (standard way or specific ways for certain compilers) e.g if(!Logical) printf("Not logical value at line number %d \n",LineNumber); // How to get LineNumber without writing it by my hand?(dynamic compilation) Thanks

    Read the article

  • Problems in "Save as PDF" plugin with Arabic numbers

    - by Mohamed Mohsen
    I use the "Save as PDF" plugin with Word 2007 to generate a PDF document from a DOCX document. It works great except that the Arabic numbers in the Word file have been converted to English numbers in the PDF document. Kindly find two links containing two screen shots explaining the problem. The first image is the generated PDF file with the English numbers highlighted. The second image is the original word file with the Arabic numbers highlighted. Update: Thanks very much Isaac, ChrisF and Wil. I changed the Numeral at word to Context and confirmed that all the numbers are Arabic at the Word file. I still have the problem as the PDF file still have English numbers. (Note: The Arabic numbers called Hindi numbers). I also tried changing the font to Tahoma with no hope.

    Read the article

  • Shooter in iOS and a visible Aim line before shooting

    - by London2423
    I have to questions. I am trying to develop a game that is iOS but I did it first in my computer so I can tested there. I was able to must of it for PC but I am having a very hard time with iOS port The problem I do have is that I don't know how to shout in iOS. To be more specific how to line render in iOS This is the script I use in my computer using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { LineRenderer line; void Start () { line = gameObject.GetComponent<LineRenderer>(); line.enabled = false; } void Update () { if (Input.GetButtonDown ("Fire1")) { StopCoroutine ("FireLaser"); StartCoroutine ("FireLaser"); } } IEnumerator FireLaser () { line.enabled = true; while (Input.GetButton("Fire1")) { Ray ray = new Ray(transform.position, transform.forward); RaycastHit hit; line.SetPosition (0, ray.origin); if (Physics.Raycast (ray, out hit,100)) { line.SetPosition(1,hit.point); if (hit.rigidbody) { hit.rigidbody.AddForceAtPosition(transform.forward * 5, hit.point); } } else line.SetPosition (1, ray.GetPoint (100)); yield return null; } line.enabled = false; { } } } Which part I have to change for iOS? I already did in the iOS the touch giu event so my player move around in the xcode/Iphone but I need some help with the shouting part. The second part of the question is where I do have to insert or change the script in order to first aim and I DO see the line of aim and then shout. Now the player can only shout. It can not aim at the gameobject, see the the line coming out of the gun aiming at the object and then shout? How I can do that. Everyone tell me Line render but that's what i did Thank you

    Read the article

  • Giving an Error Object Expected Line 48 Char 1

    - by Leslie Peer
    Giving an Error Object Expected Line 48 Char 1------What did I do wrong??? *Note Line # are for reference only not on Original Web page****** <HTML><HEAD><TITLE></TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="Leslie Peer" name=author> <META content="Created with Trellian WebPage" name=description> <META content="MSHTML 6.00.6000.16809" name=GENERATOR> <META content=Index name=keywords> <STYLE type=text/css>BODY { COLOR: #000000; BACKGROUND-REPEAT: repeat; FONT-FAMILY: Accent SF, Arial, Arial Black, Arial Narrow, Century Gothic, Comic Sans MS, Courier, Courier New, Georgia, Microsoft Sans Serif, Monotype Corsiva, Symbol, Tahoma, Times New Roman; BACKGROUND-COLOR: #666666 } A { FONT-SIZE: 14px; FONT-FAMILY: Arial Black, Bookman Old Style, DnD4Attack, Lucida Console, MS Serif, MS Outlook, MS Sans Serif, Rockwell Extra Bold, Roman, Star Time JL, Tahoma, Terminal, Times New Roman, Verdana, Wingdings 2, Wingdings 3, Wingdings } A:link { COLOR: #9966cc; TEXT-DECORATION: underline } A:visited { COLOR: #66ff66; TEXT-DECORATION: underline } A:hover { COLOR: #ffff00; TEXT-DECORATION: underline } A:active { COLOR: #ff0033; TEXT-DECORATION: underline } H1 { FONT-SIZE: 25px; COLOR: #9966cc; FONT-FAMILY: Century Gothic } H2 { FONT-SIZE: 20px; COLOR: #ff33cc; FONT-FAMILY: Century Gothic } H3 { FONT-SIZE: 18px; COLOR: #6666cc; FONT-FAMILY: Century Gothic } H4 { FONT-SIZE: 15px; COLOR: #00cc33; FONT-FAMILY: Century Gothic } H5 { FONT-SIZE: 10px; COLOR: #ffff33; FONT-FAMILY: Century Gothic } H6 { FONT-SIZE: 5px; COLOR: #996666; FONT-FAMILY: Century Gothic } </STYLE> line 46-<SCRIPT> line 47- CharNum=6; line 48-var Character=newArray();Character[0]="Larry Lightfoot";Character[1]="Sam Wrightfield";Character[2]="Gavin Hartfild";Character[3]="Gail Quickfoot";Character[4]="Robert Gragorian";Character[5]="Peter Shain"; line 49-var ExChar=newArray();ExChar[0]="Tabor Bloomfield"; line 50-var Class=newArray();Class[0]="MagicUser";Class[1]="Fighter";Class[2]="Fighter";Class[3]="Thief";Class[4]="Cleric";Class[5]="Fighter"; line 51-line 47var ExClass=newArray();ExClass[0]="MagicUser"; line 52-var Level=newArray();Level[0]="2";Level[1]="1";Level[2]="1";Level[3]="2";Level[4]="2";Level[5]="1"; line 53-var ExLevel=newArray();ExLevel[0]="23"; line 54-var Hpts=newArray();Hpts[0]="6";Hpts[1]="14";Hpts[2]="13";Hpts[3]="8";Hpts[4]="12";Hpts[5]="15"; line 55-var ExHpts=newArray();ExHpts[0]="145"; line 56-var Armor=newArray();Armor[0]="Cloak";Armor[1]="Splinted Armor";Armor[2]="Chain Armor";Armor[3]="Leather Armor";Armor[4]="Chain Armor";Armor[5]="Splinted Armor"; line 57-var ExArmor=newArray();ExArmor[0]="Robe of Protection +5"; line 58-var Ac1=newArray();Ac1[0]="0";Ac1[1]="3";Ac1[2]="3";Ac1[3]="4";Ac1[4]="2";Ac1[5]="3"; line 59-var ExAc=newArray();ExAc[0]="5"; line 60-var Armor1b=newArray();Armor1b[0]="Ring of Protection +1";Armor1b[1]="Small Shield";Armor1b[2]="Small Shield";Armor1b[3]="Wooden Shield";Armor1b[4]="Large Shield";Armor1b[5]="Small Shield"; line 61-var ExArmor1b=newArray();ExArmor1b[0]="Ring of Protection +5"; line 62-var Ac2=newArray();Ac2[0]="1";Ac2[1]="1";Ac2[2]="1";Ac2[3]="1";Ac2[4]="1";Ac2[5]="1"; line 63-var ExAc1b=newArray();ExAc1b[0]="5" line 64-var Str=newArray();Str[0]="15";Str[1]="16";Str[2]="14";Str[3]="13";Str[4]="14";Str[5]="13"; line 65-var ExStr=newArray();ExStr[0]=21; line 66-var Int=newArray();Int[0]="17";Int[1]="11";Int[2]="12";Int[3]="13";Int[4]="14";Int[5]="13"; line 67-var ExInt=newArray();ExInt[0]="19"; line 68-var Wis=newArray();Wis[0]="17";Wis[1]="12";Wis[2]="14";Wis[3]="13";Wis[4]="14";Wis[5]="12"; line 69-var ExWis=newArray();ExWis[0]="18"; line 70-var Dex=newArray();Dex[0]="15";Dex[1]="14";Dex[2]="13";Dex[3]="15";Dex[4]="14";Dex[5]="12"; line 71-var ExDex=newArray();ExDex[0]="19"; line 72-var Con=newArray();Con[0]="16";Con[1]="15";Con[2]="16";Con[3]="13";Con[4]="12";Con[5]="10"; line 73-var ExCon=newArray();ExCon[0]="19"; line 74-var Chr=newArray();Chr[0]="16";Chr[1]="14";Chr[2]="13";Chr[3]="12";Chr[4]="14";Chr[5]="13"; line 75-var ExChr=newArray();ExChr[0]="21"; line 76-var Expt=newArray();Expt[0]="45";Expt[1]="21";Expt[2]="16";Expt[3]="18";Expt[4]="22";Expt[5]="34"; line 77-var ExExpt=newArray();ExExpt[0]="245678"; line 78-var ExBp=newArray();ExBp[0]="Unknown";ExBp[1]="Extrademensional Plane World of Amborsia";ExBp[2]="Evil Wizard Banished for Mass Geniocodes"; line 79-</SCRIPT> line 80-</HEAD> line 81-<BODY> Giving an Error Object Expected Line 48 Char 1------What did I do wrong??? *Note Line # are for reference only not on Original Web page******

    Read the article

  • Exec Maven Plugin to Command Line

    - by mistercaste
    I have an application developed in NetBeans/Maven that can be started via command line with: mvn exec:exec "-Dexec.executable=C:\\Java\\jdk1.6.0_33\\bin\\java.exe" "-Dexec.args=-Dlog4j.properties=... -classpath %classpath com.xxx.MyLauncher" -Dexec.classpathScope=runtime -Dexec.workingdir= Now I need to run the application through the standard java command line method, like: java -Dlog4j.properties=... -jar myapp-1.2-SNAPSHOT.jar Unfortunately this does not work in the same manner, as I get the following exception: opencard.core.util.OpenCardPropertyLoadingException: property file not found Questions: What is the difference between launching applications with the Exec-Maven-plugin and the standard java execution on command line? Is there an easy way to convert a Maven execution script to a standard command line? How to run the application succesfully?

    Read the article

  • Connect to a network via the command line [closed]

    - by justasking
    I want to be able to connect to a network via command line in Windows. My goal is to script out remoting into my work computer. I hate having to always manually connect to the VPN connection and then rdping into my work machine. I want to just have a script which will do both of it for me. I know how to rdp via command line, I just need to know how to connect to my VPN via command line.

    Read the article

  • replace line with sed in csh

    - by not_a_geek
    Hello, I am trying to change the content of a specific line in a batch of files. I thought that would be a piece of cake but for some reason, nothing happens, so I guess I am missing something. Line 8 should have been replaced. Here the csh script I used: !/bin/csh # replace context in line xxx by yyy 2010/05/07 set files = ls FILENAMEPART* echo $files foreach file ($files) sed '8,8 s/1/2 /' $file end thanks for suggestions

    Read the article

  • MATLAB: Drawing a line over a black and white image

    - by Richard
    This is quite possibly an extremely retarded question, but what is the best way to draw a line over a black and white (binary) image in MATLAB, provided the start and end coordinates are known? Please note, I am not trying to add an annotation line, I would like the line to become part of the image.

    Read the article

  • command line merge tools for windows

    - by hasen j
    Are there command line merge tools for windows? I'm thinking in terms of tools that can be used in conjunction with other tools (e.g. git, unison) to resolve conflicts. Actually, it doesn't need to strictly be command-line based, as long as it "cooperate" with other command line tools (as I mentioned, git for example), then it's fine.

    Read the article

  • Delphi: Center Specific Line in TRichEdit by Scrolling

    - by Anagoge
    I have a Delphi 2007 TRichEdit with several lines in it. I want to scroll the richedit vertically such that a specific line number if approximately centered in the visible/display area of the richedit. For example, I want to write the code for CenterLineInRichEdit in this example: procedure CenterLineInRichEdit(Edit: TRichEdit; LineNum: Integer); begin ... Edit.ScrollTo(...); end; procedure TForm1.FormCreate(Sender: TObject); var REdit: TRichEdit; i: Integer; begin REdit := TRichEdit.Create(Self); REdit.Parent := Self; Redit.ScrollBars := ssVertical; REdit.SetBounds(10, 10, 200, 150); for i := 1 to 25 do REdit.Lines.Add('This is line number ' + IntToStr(i)); CenterLineInRichEdit(REdit, 13); end; I looked into using the WM_VSCROLL message, and it allows scrolling up/down one line, etc. but not scrolling to center a specific line. I assume I would need to calculate the line height, the display area height, etc? Or is there an easier way?

    Read the article

  • Finding Line Beginning using Regular expression in Notepad++

    - by Michel Merlin
    Finding Line Beginning using Regular expression in Notepad++ (Sorry if this is a newbie question) I want to strip a 4000-line HTML file from all the jQuery "done" stuff, e.g.: <DIV class=menu done27="1" done26="0" done9="1" done8="0" done7="1" done6="0" done4="20"> should be replaced with: <DIV class=menu> In http://www.zytrax.com/tech/web/regex.htm#experiment I can do it with RE: [ ^]done[0-9]+="[0-9]+" but in Notepad++ 5.6.8 UNICODE, in a .HTM file encoded in ANSI, Search Find, Search mode = Regular expression, putting this RE in the "Find what" field won't work (it will only find the 5 occurrences starting with a space, it will miss the 2 occurrences starting at the beginning of a line; IOW, the caret for line beginning, or the alternating it with a space, fails). How do I? TIA, Versailles, Wed 21 Apr 2010 10:42:20 +0200

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >