Search Results

Search found 22668 results on 907 pages for 'command prompt'.

Page 23/907 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • 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

  • Sending mail from command line if body not empty

    - by cdecker
    I'd like to write a simple script that alerts me if a log changes. For this I'm using grep to find the lines I'm interested in. Right now it works like this: grep line /var/log/file | mail -s Log [email protected] Problem is that this sends a mail even if no matching lines are found. The mail utility from mailutils seems to have no switch telling it to drop mails that have an empty body. Is there a quick and easy way to do so?

    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

  • Windows Command queue?

    - by Stefano
    i'm thinking if does exist some kind of software that can put in a queue a bunch of windows commands... for example i can say to first copy some file somewhere, then rename those, then delete the old files, then edit one of them etc.... without waiting the effective execution of any of those passages.... this could be useful when copying big files that take a lot and i don't want to sit in front of the computer keeping the eyes on the progress bar... does exist anything like this?

    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

  • How to find the number of packages needing update from the command line?

    - by KayEss
    I'm working on some system admin automation using fabric and I'd like to be able to monitor the number of packages that need upgrading on a given machine. This is the same information that I can see when I first log in to a machine, i.e. this part: 35 packages can be updated. 22 updates are security updates. Is there a command that I can run (preferably without sudo) that gives just that information? I'd also like to know whether or not apg/dpkg thinks that the machine needs a reboot after packages are installed/upgraded. bybobu shows this at the bottom of the screen. That way I can decide whether or not to reboot machines after I update packages a bit more intelligently. I've looked at the apt-python bindings, but they seem to have a high learning curve and they also appear to be changed around a lot -- I'd like something that will work at least as far back as lucid without needing to do different things on different Ubuntu versions.

    Read the article

  • How to disable Alert volume from the command line?

    - by Bryce
    There is an option in the Sound Preferences dialog, Sound Effects tab, to toggle Alert volume 'mute'. It works and suffices for my needs to disable the irritating system beep/bell. However, I reinstall systems a LOT for testing purposes and would like to set this setting in a shell script so it's off without having to fiddle with a GUI. But for the life of me I can't seem to find where this can be toggled via a command line tool. I've scanned through gconf-editor, pulseaudio's pacmd, grepped through /etc, even dug through the gnome-volume-control source code, but I am not seeing how this can be set. I gather that gnome-volume-control has changed since a few releases ago. Ideas?

    Read the article

  • How to disable Alert volume from the command line in Natty?

    - by Bryce
    There is an option in the Sound Preferences dialog, Sound Effects tab, to toggle Alert volume 'mute'. It works and suffices for my needs to disable the irritating system beep/bell. However, I reinstall systems a LOT for testing purposes and would like to set this setting in a shell script so it's off without having to fiddle with a GUI. But for the life of me I can't seem to find where this can be toggled via a command line tool. I've scanned through gconf-editor, pulseaudio's pacmd, grepped through /etc, even dug through the gnome-volume-control source code, but I am not seeing how this can be set. I gather that gnome-volume-control has changed since a few releases ago. I'm using Natty fwiw. Ideas?

    Read the article

  • Is there a command-line utility app which can locate a specific block of lines in a text file?

    - by fred.bear
    The text "search and replace" utility programs I've seen, seem to only search on a line-by-line basis... Is there a command-line tool which can locate one block of lines (in a text file), and replace it with another block of lines.? For example: Does the test file file contain this exact group of lines: 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. 'Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!' I want this, so that I can replace multiple lines of text in a file and know I'm not overwriting the wrong lines. I would never replace "The Jabberwocky" (Lewis Carroll), but it makes a novel example :)

    Read the article

  • How Can I Upgrade to 11.10 from the Command Line?

    - by nmagerko
    I am trying to upgrade my 11.04 Ubuntu operating system to 11.10, as the current system is not the most recent. However, I cannot use the GUI to upgrade - as from past experience I have learned this - because my graphics hardware only works on 10.04 to 11.04 (non-inclusive) and from 11.10+. So once I can get to 11.10, I should be just fine. Because of this, I need to find a way to upgrade the OS from the command line. Can this be done? Thanks for any and all help.

    Read the article

  • Why did this command make my Ubuntu more awesome than before?

    - by the_misfit
    After running Ubuntu for months and liking it, I for the first time wanted to use headphones and was trying to get them to work so I ran the code in step 1 https://help.ubuntu.com/community/SoundTroubleshootingProcedure -- the result was an improvement in performance, resolution, and audio.. a vast improvement. What does that suggest about what was wrong with my settings before if running this improved system performance, graphics, and my audio problem? The command is: sudo add-apt-repository ppa:ubuntu-audio-dev/ppa; sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`

    Read the article

  • Command to determine whether a fullscreen application is running?

    - by George Edison
    I have a small shell script that plays a little jingle and displays a notification whenever I get a new email. The problem is that this shell script can get invoked anytime - including when I'm watching a DVD / video in fullscreen mode with the sound turned up quite a bit - which is quite annoying. I'd like to enhance this script with the ability to detect whether an application is in fullscreen mode. I know this must be somehow possible because notifications don't display under those circumstances. What command can I use?

    Read the article

  • Is it possible for an application (written in Mono C#) to run a console command?

    - by Razick
    I am wondering if a Mono C# application can somehow run a terminal command. For example, could the user give the program his or her password and then have the application run sudo apt-get install application-name (console requests password) password (console requests confirmation) y Preferably, this would be done without actually opening a terminal visible to the user, so that the application could provide the necessary feedback and manage the whole operation cleanly with as little user interaction as possible. Is there a way to do that? Let me know if clarification is needed. Thank you!

    Read the article

  • How do I set command line mode vga=788 permanently?

    - by George
    I have a problem that is not of easy resolution, happen to tell... I have Installed Ubuntu 10.10 Server. I want to join to the system way vga=788, into the grub it changes without any problem editing the file grub.cfg, the problem is that editing the above mentioned file I join to the system way vga=788 (800x600) and then command line puts itself in way vga=792 (1280x1024). Is there any way of changing this configuration so that it is always vga=788? tanks. sorry for my english :D

    Read the article

  • How can I get the name of the current terminal from command-line?

    - by Xubu-Tur
    Is there a possibility to get the type of terminal with a command? If I'm using gnome-terminal the output should be gnome-terminal or something similar. It would be also nice to get the version of the terminal. Update ps -aux | grep `ps -p $$ -o ppid=` will output something like this: user 4239 0.0 0.7 292708 15744 pts/8 Sl 11:39 0:02 xfce4-terminal user 4800 0.0 0.0 6176 820 pts/0 S+ 12:23 0:00 grep --color=auto 4239 This will also work with xterm, but i don't know how to get only the name (xfce4-terminal in this case).

    Read the article

  • Command line option to check which filesystem I am using?

    - by j-g-faustus
    Is there a command that will show which file system (ext3, ext4, FAT32, ...) the various partitions and disks are using? Similar to how sudo fdisk -l lists information about disks and partitions? Update Accepted the "mount" answer as mount works without specifying filesystem type (commenting out the relevant entries in fstab, if any): $ sudo mount /dev/sdf1 /mnt/tmp $ mount | grep /mnt/tmp /dev/sdf1 on /mnt/tmp type ext3 (rw) Found another option in ubuntuforums - blkid: # system disk $ sudo blkid /dev/sda1 /dev/sda1: UUID="...." TYPE="ext4" # USB disk: $ sudo blkid /dev/sdf1 /dev/sdf1: LABEL="backup" UUID="..." TYPE="ext3" # mdadm RAID: $ sudo blkid /dev/md0 /dev/md0: LABEL="raid" UUID="..." TYPE="ext4" Thanks for your help!

    Read the article

  • How can I redirect the contents of a file to the pastebinit command? [duplicate]

    - by Tim
    This question already has an answer here: How to submit a file to paste.ubuntu.com without graphical interface? 2 answers Whenever I was to store something to show someone here, I run command-with-output | pastebinit. That returns the link to the paste online. For example: echo timtjtim | pastebinit gave me the link paste.ubuntu.com/8010000 Which I can share. How can I do this with a file - for example a log file. Surely I don't have to open - > copy all - > open paste.ubuntu.com -> paste it?

    Read the article

  • Can I set command line executed games to open in a window instead of fullscreen?

    - by ajwhitaker822
    I really enjoy some of the free Linux games and just downloaded Cave Story, one of my all-time favorites. However, I can only play the game in full screen, 800X600 Resolution. I was wondering if I could run this program in a window instead of full screen. Is there a command or Unity plugin to do this? Also, would the same work to run SuperTux in a window as well? I'm running 12.04 if that makes any difference. Thanks for your help.

    Read the article

  • design for a wrapper around command-line utilities

    - by hatchetman82
    im trying to come up with a design for a wrapper for use when invoking command line utilities in java. the trouble with runtime.exec() is that you need to keep reading from the process' out and err streams or it hangs when it fills its buffers. this has led me to the following design: public class CommandLineInterface { private final Thread stdOutThread; private final Thread stdErrThread; private final OutputStreamWriter stdin; private final History history; public CommandLineInterface(String command) throws IOException { this.history = new History(); this.history.addEntry(new HistoryEntry(EntryTypeEnum.INPUT, command)); Process process = Runtime.getRuntime().exec(command); stdin = new OutputStreamWriter(process.getOutputStream()); stdOutThread = new Thread(new Leech(process.getInputStream(), history, EntryTypeEnum.OUTPUT)); stdOutThread.setDaemon(true); stdOutThread.start(); stdErrThread = new Thread(new Leech(process.getErrorStream(), history, EntryTypeEnum.ERROR)); stdErrThread.setDaemon(true); stdErrThread.start(); } public void write(String input) throws IOException { this.history.addEntry(new HistoryEntry(EntryTypeEnum.INPUT, input)); stdin.write(input); stdin.write("\n"); stdin.flush(); } } public class Leech implements Runnable{ private final InputStream stream; private final History history; private final EntryTypeEnum type; private volatile boolean alive = true; public Leech(InputStream stream, History history, EntryTypeEnum type) { this.stream = stream; this.history = history; this.type = type; } public void run() { BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); String line; try { while(alive) { line = reader.readLine(); if (line==null) break; history.addEntry(new HistoryEntry(type, line)); } } catch (Exception e) { e.printStackTrace(); } } } my issue is with the Leech class (used to "leech" the process' out and err streams and feed them into history - which acts like a log file) - on the one hand reading whole lines is nice and easy (and what im currently doing), but it means i miss the last line (usually the prompt line). i only see the prompt line when executing the next command (because there's no line break until that point). on the other hand, if i read characters myself, how can i tell when the process is "done" ? (either complete or waiting for input) has anyone tried something like waiting 100 millis since the last output from the process and declaring it "done" ? any better ideas on how i can implement a nice wrapper around things like runtime.exec("cmd.exe") ?

    Read the article

  • In Java, send commands to another command-line program

    - by bradvido
    I am using Java on Windows XP and want to be able to send commands to another program such as telnet. I do not want to simply execute another program. I want to execute it, and then send it a sequence of commands once it's running. Here's my code of what I want to do, but it does not work: (If you uncomment and change the command to "cmd" it works as expected. Please help.) try { Runtime rt = Runtime.getRuntime(); String command = "telnet"; //command = "cmd"; Process pr = rt.exec(command); BufferedReader processOutput = new BufferedReader(new InputStreamReader(pr.getInputStream())); BufferedWriter processInput = new BufferedWriter(new OutputStreamWriter(pr.getOutputStream())); String commandToSend = "open localhost\n"; //commandToSend = "dir\n" + "exit\n"; processInput.write(commandToSend); processInput.flush(); int lineCounter = 0; while(true) { String line = processOutput.readLine(); if(line == null) break; System.out.println(++lineCounter + ": " + line); } processInput.close(); processOutput.close(); pr.waitFor(); } catch(Exception x) { x.printStackTrace(); }

    Read the article

  • Hiding Command Prompt with CodeDomProvider

    - by j-t-s
    Hi All I've just got my own little custom c# compiler made, using the article from MSDN. But, when I create a new Windows Forms application using my sample compiler, the MSDOS window also appears, and if I close the DOS window, my WinForms app closes too. How can I tell the Compiler? not to show the MSDOS window at all? Thank you :) Here's my code: using System; namespace JTS { public class CSCompiler { protected string ot, rt, ss, es; protected bool rg, cg; public string Compile(String se, String fe, String[] rdas, String[] fs, Boolean rn) { System.CodeDom.Compiler.CodeDomProvider CODEPROV = System.CodeDom.Compiler.CodeDomProvider.CreateProvider("CSharp"); ot = fe; System.CodeDom.Compiler.CompilerParameters PARAMS = new System.CodeDom.Compiler.CompilerParameters(); // Ensure the compiler generates an EXE file, not a DLL. PARAMS.GenerateExecutable = true; PARAMS.OutputAssembly = ot; PARAMS.CompilerOptions = "/target:winexe"; PARAMS.ReferencedAssemblies.Add(typeof(System.Xml.Linq.Extensions).Assembly.Location); PARAMS.LinkedResources.Add("this.ico"); foreach (String ay in rdas) { if (ay.Contains(".dll")) PARAMS.ReferencedAssemblies.Add(ay); else { string refd = ay; refd = refd + ".dll"; PARAMS.ReferencedAssemblies.Add(refd); } } System.CodeDom.Compiler.CompilerResults rs = CODEPROV.CompileAssemblyFromFile(PARAMS, fs); if (rs.Errors.Count > 0) { foreach (System.CodeDom.Compiler.CompilerError COMERR in rs.Errors) { es = es + "Line number: " + COMERR.Line + ", Error number: " + COMERR.ErrorNumber + ", '" + COMERR.ErrorText + ";" + Environment.NewLine + Environment.NewLine; } } else { // Compilation succeeded. es = "Compilation Succeeded."; if (rn) System.Diagnostics.Process.Start(ot); } return es; } } }

    Read the article

  • Processing command-line arguments in prefix notation in Python

    - by ejm
    I'm trying to parse a command-line in Python which looks like the following: $ ./command -o option1 arg1 -o option2 arg2 arg3 In other words, the command takes an unlimited number of arguments, and each argument may optionally be preceded with an -o option, which relates specifically to that argument. I think this is called a "prefix notation". In the Bourne shell I would do something like the following: while test -n "$1" do if test "$1" = '-o' then option="$2" shift 2 fi # Work with $1 (the argument) and $option (the option) # ... shift done Looking around at the Bash tutorials, etc. this seems to be the accepted idiom, so I'm guessing Bash is optimized to work with command-line arguments this way. Trying to implement this pattern in Python, my first guess was to use pop(), as this is basically a stack operation. But I'm guessing this won't work as well on Python because the list of arguments in sys.argv is in the wrong order and would have to be processed like a queue (i.e. pop from the left). I've read that lists are not optimized for use as queues in Python. So, my ideas are: convert argv to a collections.deque and use popleft(), reverse argv using reverse() and use pop(), or maybe just work with the int list indices themselves. Does anyone know of a better way to do this, otherwise which of my ideas would be best-practise in Python?

    Read the article

  • Invoke Command When "ENTER" Key Is Pressed In XAML

    - by bitxwise
    I want to invoke a command when ENTER is pressed in a TextBox. Consider the following XAML: <UserControl ... xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" ...> ... <TextBox> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyUp"> <i:InvokeCommandAction Command="{Binding MyCommand}" CommandParameter="{Binding Text}" /> </i:EventTrigger> </i:Interaction.Triggers> </TextBox> ... </UserControl> and that MyCommand is as follows: public ICommand MyCommand { get { return new DelegateCommand<string>(MyCommandExecute); } } private void MyCommandExecute(string s) { ... } With the above, my command is invoked for every key press. How can I restrict the command to only invoke when the ENTER key is pressed? I understand that with Expression Blend I can use Conditions but those seem to be restricted to elements and can't consider event arguments. I have also come across SLEX which offers its own InvokeCommandAction implementation that is built on top of the Systems.Windows.Interactivity implementation and can do what I need. Another consideration is to write my own trigger, but I'm hoping there's a way to do it without using external toolkits.

    Read the article

  • Is there a command-line utility app which can find a specific block of lines in a text file, and replace it?

    - by fred.bear
    UPDATE (see end of question) The text "search and replace" utility programs I've seen, seem to only search on a line-by-line basis... Is there a command-line tool which can locate one block of lines (in a text file), and replace it with another block of lines.? For example: Does the test file file contain this exact group of lines: 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. 'Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!' I want this, so that I can replace multiple lines of text in a file and know I'm not overwriting the wrong lines. I would never replace "The Jabberwocky" (Lewis Carroll), but it makes a novel example :) UPDATE: ..(sub-update) My following comment about reasons when not use sed are only in the context of; don't push any tool too far beyond its design intent (I use sed quite often, and consider it to be invaluable.) I just now found an interesting web page about sed and when not to use it. So, because of all the sed answers, I"ll post the link.. it is part of the sed FAQ on sourceforge Also, I'm pretty sure there is some way diff can do the job of locating the block of text (once it's located, the replacement is quite straight foward; using head and tail) ... 'diff' dumps all the necessary data, but I haven't yet worked out how to filter it , ... (I'm still working on it)

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >