Search Results

Search found 25651 results on 1027 pages for 'shell script'.

Page 11/1027 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Close all Mac Terminal windows, but the one running a script

    - by Greg Brown
    I am trying to create a shell script that runs a python simulation programing in 4 terminal windows. I have the script that launches the program four times in four separate terminal windows(total of 5 windows, 4 for the python programs, and one to control the other terminal windows). I want to now create a script that I can run in the control terminal window that closes and kills the programs of the other four terminal windows, but still have the control one open. What I have so far is something like this #!/bin/sh osascript -e 'tell app "Terminal" do script "killall python" end tell' osascript -e 'tell app "Terminal" to quit' osascript -e 'tell app "Terminal" to open' The problem is that the last line doesn't work because it closes all the windows including the one the script is executing in. I am not really familiar with shell or apple script so any help would be welcomed. I posted on Stack, but I think this might be a better place for an automation type question. Thanks

    Read the article

  • chroot'ing SSH home directories, shell problem.

    - by Hamza
    Hi folks, I am trying to chroot my SSH users to their home directories and it seems to work.. in a strange way. Here is what I have in my sshd_config: Match group restricthome ChrootDirectory %h The permissions on the user directories looks like this: drwxr-xr-x 2 root root 1024 May 11 13:45 [user]/ And I can see that the user logs in successfully: May 11 13:49:23 box sshd[5695]: Accepted password for [user] from x.x.x.x port 2358 ssh2 (with no error messages after this) But after entering the password the PuTTY window closes down. This is a wild guess, but could it be because the user's shell is set to /bin/bash and it can't execute because of the chroot? If so, could you give me pointers on how to fix it? Would simply copying the bash binary into user's home directory and modyfying the shell work? How would I deal with the dependencies, ldd shows quite a few of those :) Comments/suggestions will be appreciated. Thanks.

    Read the article

  • Default prolog for all ZSH scripts?

    - by Igor Spasic
    I have a file that contains several helper functions, meant to be used only in other ZSH scripts. I do not want them to be loaded with my profile. To make these functions available in my script, I would need to source this file. Is it somehow possible to have automatic prolog script (or pre-script) loaded before all my ZSH scripts? My current idea is to alias -s zsh extension to custom function that those all this for me: concatenate prolog file and current script calls zsh with such modified input but for now I am somehow not able to do this (haven't sleep for almost a day). Please, does anyone have a working solution?

    Read the article

  • echo newline character not working in bash

    - by Bashuser
    I have bash script which has lots of echo statements and also I aliased echo to echo -e both in .bash_profile and .bashrc, so that new lines are printed properly for a statement like echo 'Hello\nWorld' the output should be Hello World but the output I am getting is Hello\nWorld I even tried using shopt -s expand_aliases in the script, it doesn't help I am running my script as bash /scripts/scriptnm.sh; if I run it as . /scripts/scriptnm.sh I am getting the desired output...

    Read the article

  • Alternative shell apps for OS X

    - by Joseph Silvashy
    This might sound ridiculous, but my eyes are tired of looking at the crappy font rendering in OS X's Terminal.app, is there anything you guys recommend? I know it's like one of those things that you can easily say, "It's shell! what more can you ask for!" but really, all these great methods for rendering fonts and anti-aliasing, and we developers haven't even integrated that into our most trusty tool... at least that I know of. Anyhow, let's discus shell alternatives, thoughts?

    Read the article

  • jZip isn't integrating with Windows 7 shell

    - by Aayush
    I installed jZip in my new windows 7 64 bit OS. but it doesn't seem to integrate with the shell. It doesn't appear in the right click menu on any file(not even zip files). To zip a file I have to open jZip go to file-new and browse for the files and to extract compressed files I have to open the file in jZip then click on extract, there is no right click menu integration what so ever, although It used to have when I had jZip on the Windows 7 RC. I reinstalled checking the settings incase I made a mistake but I checked shell integration while installation. Don't know what it wrong? anyone know how I should solve this. Help..? Thanks!

    Read the article

  • linux shell, keep task alive for specified time

    - by liori
    Hello, I am looking for a tool to keep a task alive (restarting if necessary) for a specified amount of time (in seconds), and then kill it and stop. For example: keep_for 3600 rsync foo bar:faz should for try to synchronize a directory (restarting rsync in case of f.e. dropped connection), but explicitly kill rsync and stop respawning it after an hour. I tried to write a shell script for that, but it was surprisingly difficult to write, with lots of edge cases (like child process not getting killed, or shell escaping issues). So... maybe there already is a tool for that?

    Read the article

  • something strange about Win-XP's command shell

    - by user1762055
    I wrote the following command in windows XP's command shell and something strange happened: C:\Folder1> copy sample.txt : Because of my typing mistake, I wrote ":" instead of "D:" ... but it copied the sample.txt to somewhere I cant find! I searched my whole HDD for sample.txt but the only instance of this file is the original one which is in C:\Folder1. Do you know where ":" path actually is in Win-XP command shell? You might say ":" is current path and the file has been copied onto itself but look at this: If you run that command for the first time, this will be the result: 1 file copied. but the next time you run that command it will ask you: overwrite sample.txt? (yes/no/all) So if it were writing the file onto itself, both results would have to be the same but they aren't. Thanks in advance for your help.

    Read the article

  • How can I terminate a multicast stream (asr - Mac) in a script?

    - by user355896
    Hello, I'm making a script to to run a bunch of multicast asr streams, but I do not know how to "stop" or "end" a multicast asr stream after a certain amount of time. Loop Suspend does not do what I'm looking for. I've also tried to add a sleep command followed by a kill command, but they kick in after the stream ends (so that approach does not work). Thanks for any possible help! By the way, I'm writing this script in bash.

    Read the article

  • Refer to te current directory in a shell script

    - by One Two Three
    How do I refer to the current directory in a shell script So I have this script which calls another script in the same directory #! /bin/sh #Call the other script ./foo.sh # do something ... For this I got ./foo.sh: No such file or directory So I changed it to: #! /bin/sh #Call the other script foo.sh # do something ... But this would call the foo script which is, by default, in the PATH. This is not what I want. So the question is, what's the syntax of doing './` in a shell script?

    Read the article

  • Windows Shell Programming book suggestion

    - by Lijo
    Hi, I am a web developer using C#. I would like to experiment with Windows shell programming in C#. Many people suggests that using managed applications for shell program, is dangerous. (Creation of separate instances for each process versus in process shell. Also version dependency) Frankly speaking, I am totally new to shell. Is there a book available, that will treat these topics; both through managed code and unmanaged code (but mostly towards managed code)? It would be great if that book is concise , for beginner and giving theoretical background of the shell. Please suggest…. Thanks Lijo

    Read the article

  • Launch only the command if the previous one worked inside SSH, SHELL

    - by Namari
    I've got a SHELL script which is using a pipe to separate my 2 commands: ssh -oBatchMode=yes user@hostname "mysql -u yop -pyop -c yop | echo test" The problem is even if my connection to mysql doesn't work, it send the echo test. I would like to forbid my script to send any command if the previous command doesn't work. I search with a if condition but it seems it not possible with it :( Does anyone have an idea ? Thanks, Namari

    Read the article

  • Gnome-Shell panel disappeared - How to get it back?

    - by Arindom
    I am on Gnome-Shell and using Ubuntu 11.10. The problem is after a recent update and also after installing a few extensions, when I logged in to Gnome Shell, I can't find the top panel or AWN. Only the wallpaper is showing and then Conky is displaying. It also seems to me that for some reason the display effects are not working and that is why AWN is not showing. Need your help to get back the panel.

    Read the article

  • How to execute a script as super user first checking the user and getting pass from askpass if not super user

    - by pahnin
    thers a similar question out there How can I determine whether a shellscript runs as root or not? I have the same doubt with different result Is it possible to, within the BASH script prior to everything being run, check if the script is being run as superuser, and if not, print a message saying You must be superuser to use this script, then subsequently get pass from the user using askpass or something like tht then execute the saem script as superuser?

    Read the article

  • How do I embed an expect script that takes in arguments into a bash shell script?

    - by fzkl
    I am writing a bash script which amongst many other things uses expect to automatically run a binary and install it by answering installer prompts. I was able to get my expect script to work fine when the expect script is called in my bash script with the command "expect $expectscriptname $Parameter". However, I want to embed the expect script into the shell script instead of having to maintain two separate script files for the job. I searched around and found that the procedure to embed expect into bash script was to declare a variable like VAR below and then echo it.: VAR=$(expect -c " #content of expect script here ") echo "$VAR" 1) I don't understand how echoing $VAR actually runs the expect script. Could anyone explain? 2) I am not sure how to pass $Parameter into VAR or to the echo statement. This is my main concern. Any ideas? Thanks.

    Read the article

  • Run shell script using fabric and piping script text to shell's stdin

    - by Peter Lyons
    Is there a way to execute a multi-line shell script by piping it to the remote shell's standard input in fabric? Or must I always write it to the remote filesystem, then run it, then delete it? I like sending to stdin as it avoids the temporary file. If there's no fabric API (and it seems like there is not based on my research), presumably I can just use the ssh module directly. Basically I wish fabric.api.run was not limited to a 1-line command that gets passed to the shell as a command line argument, but instead would take a full multi-line script and write it to the remote shell's standard input.

    Read the article

  • Open an Emacs buffer when a command tries to open an editor in shell-mode

    - by Chris Conway
    I like to use Emacs' shell mode, but it has a few deficiencies. One of those is that it's not smart enough to open a new buffer when a shell command tries to invoke an editor. For example with the environment variable VISUAL set to vim I get the following from svn propedit: $ svn propedit svn:externals . "svn-prop.tmp" 2L, 149C[1;1H ~ [4;1H~ [5;1H~ [6;1H~ [7;1H~ ... (It may be hard to tell from the representation, but it's a horrible, ugly mess.) With VISUAL set to "emacs -nw", I get $ svn propedit svn:externals . emacs: Terminal type "dumb" is not powerful enough to run Emacs. It lacks the ability to position the cursor. If that is not the actual type of terminal you have, use the Bourne shell command `TERM=... export TERM' (C-shell: `setenv TERM ...') to specify the correct type. It may be necessary to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.svn: system('emacs -nw svn-prop.tmp') returned 256 (It works with VISUAL set to just emacs, but only from inside an Emacs X window, not inside a terminal session.) Is there a way to get shell mode to do the right thing here and open up a new buffer on behalf of the command line process?

    Read the article

  • Mac OS X: Update Python for Shell

    - by Nathan G.
    So, I see similar questions, but none of the answers work for me. I updated Python to 3.1.3 from 2.6.1. Everything works, except: When I type python into Terminal, I get: Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> So, how do I change the version of Python that runs in the Shell? I've tried the script that they provide. It adds their directory to my $PATH, but it still doesn't change the version that'd displayed from Terminal. Here's what I get when I echo $PATH: /Library/Frameworks/Python.framework/Versions/3.1/bin:/Library/Frameworks/Python.framework/Versions/3.1/bin:/Library/Frameworks/Python.framework/Versions/3.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin It appears that the script provided has added their directory for every time I ran the script (I tried it a few times, naturally). I'll gives links to caps of what is in the other relevant folders it mentions: /Library/Frameworks/Python.framework/Versions/3.1/bin /usr/local/bin /usr/bin Thakns in advance for any ideas!

    Read the article

  • storing passed arguments in separate variables -shell scripting

    - by Nathan Pk
    In my script "script.sh" , I want to store 1st and 2nd argument to some variable and rest to another separate variable. What command I must use to implement this task? Number of arguments that is passed to a script is random) When I run the command in console ./script.sh abc def ghi jkl mn o p qrs xxx #It can have any number of arguments In this case, I want my script to store "abc" and "def" in one variable. "ghi jkl mn o p qrs xxx" should be stored in another variable.

    Read the article

  • How to add commands of windows to local shell of XShell 4

    - by dylanninin
    XShell is a very powerful tools to ssh remote computers such as Unix/Linux. And it has built some internal commands for you to run within your Windows. Xshell:\> help Internal Commands: new: Creates a new session. open: Opens a session or the session dialog box. edit: Opens the Session Property dialog box for a session. list: Lists information of all available sessions. 'ls' and 'dir' do the same. cd: Changes the current working directory. clear: Clears the screen/address/command history. help: Displays this help. '?' does the same. quit: Quits Local Shell. 'exit' does the same. ssh: Connects to a host using the SSH protocol. telnet: Connects to a host using the TELNET protocol. rlogin: Connects to a host using the RLOGIN protocol. sftp: Connects to a host to transfer files securely. ftp: Connects to a host to transfer files. External Commands: ipconfig: Configures TCP/IP network interfaces. ping: Sends ICMP ECHO_REQUEST packets to network hosts. tracert: Prints the route packets take to network host. netstat: Displays current protocol statistics and current TCP/IP network connections. nslookup: Resolves a hostname to IP address. For more information, type 'help command' for each command. ex) help telnet But these commands are limited, so how to add commands of windows to local shell of XShell 4

    Read the article

  • Shell replacement for kiosk environment with desktop icons

    - by tuesprem
    I have to deploy around 80 touch-screen terminals for my company. We're going to run several Windows applications on those terminals and they'll be operated by touch input only. I basically want those machines to run in a kiosk mode, so employees won't be able to launch any programs than the ones they're supposed to (also, this will hide the task bar/start menu, which will give it a much nicer, corporate look). There's usually one app that should automatically launch on startup and other apps that can be launched from the desktop. I've tried to accomplish this (under Windows 7 Pro) with a custom shell replacement. This removes the task bar/start menu like I described earlier. I used an AutoHotKey script for this, because it's easy to, for instance, define hotkeys so admins will still be able to launch stuff like Windows Explorer (okay, I know I could just launch it from the task manager [Ctrl+Shift+Esc] but I'm considering locking that as well). So far so good. Some problems though: No desktop icons. Needed to launch apps from the desktop. No wallpaper. Required for CI. Is there any way around this? I wouldn't mind using another shell replacement, as long as it's reasonably lightweight. I'd love to get the wallpaper and desktop icons to show with something like AutoHotKey though. Thanks!

    Read the article

  • How do you run the previous command in emacs shell?

    - by Lidmith
    I am in terminal mode on Ubuntu, and I'm running emacs with 2 buffers open, one is a ruby file, and the other is a shell (opened by typing M-x shell ), and when I switch to the shell buffer, I want to run the same command that I ran before. I would normally just hit the up arrow in a terminal window, but in emacs, it simply puts the cursor up one line. Does anyone know of keystroke to run the previous shell command from within an emacs shell?

    Read the article

  • A Forming Repository of Script Samples for Automating Windows Server 2012 and Windows 8

    - by Jialiang
    Compared with Windows Server 2008/R2 that provides about 230 cmdlets, Windows Server 2012 beats that by a factor of over 10 shipping ~ 2,430 cmdlets.  You can automate almost every aspect of the server.   The new PowerShell 3.0, like Windows Server 2012, has a ton of new features.  In this automation script-centric move, Microsoft All-In-One Script Framework (AIOSF) is ready to support IT Pros with many new services and offerings coming this year.  We sincerely hope that the IT community will benefit from the effort. Here is the first one among our new services and offerings:  The team is preparing a large set of Windows 8 / Windows Server 2012 script samples based on frequently asked IT tasks that we collect in TechNet forums and support calls to Microsoft.   Because the script topics come from frequently asked IT tasks, we hope that these script samples can be helpful to many IT Pros worldwide.   With the General Availability of Windows Server 2012, we release the first three Windows Server 2012 / Windows 8 script samples today.    Get Network Adapter Properties in Windows Server 2012 and Windows 8 (PowerShell) http://gallery.technet.microsoft.com/scriptcenter/Get-Network-Adapter-37c5a913 Description: This script could be used to get network adapter properties and advanced properties in Windows Server 2012 and Windows 8. It combines the outputs of Get-NetAdapter and Get-NetAdapterAdvancedProperty. It can generate a report of network adapter configuration settings. Use Scenarios: In a real world, IT Administrators are required to check the configuration of network adapters after the deployment of new servers. One typical example is the duplex setting of network adapters. Also, IT administrators need to maintain a server list which contains network adapter configuration settings in a regular basis. Before Windows Server 2012, IT administrators often feel difficulties to handle these tasks. Acknowledgement: Thanks Greg Gu from AIOSF for collecting this script topic, and writing the script sample.  Thanks James Adams (Microsoft Premier Field Engineer) for reviewing the script sample and ensuring its quality.   How to batch create virtual machines in Windows Server 2012 (PowerShell) http://gallery.technet.microsoft.com/scriptcenter/How-to-batch-create-9efd1811 Description: This PowerShell Script illustrates how to batch create multiple virtual machines based on comma delimited file by using PowerShell 3.0 in Windows Server 2012. Use Scenarios: IT admin requires to batch creating virtual machines in Windows Server 2012, although they can use few commands due to the lack of programming knowledge. Although it’s a set of Hyper-V command-lets within Windows PowerShell, IT Admins are reluctant to use them except simple a command which is widely used. Acknowledgement: Thanks Anders Wang from AIOSF for collecting this script topic and writing the script sample.  Thanks Christopher Norris for reviewing the script sample and ensuring its quality before publishing.   Remove Windows Store Apps in Windows 8 (PowerShell) http://gallery.technet.microsoft.com/scriptcenter/Remove-Windows-Store-Apps-a00ef4a4 Description: This script can be used to remove multiple Windows Store Apps from a user account in Windows 8. It provides a list of installed Windows Store applications. You can specify the application IDs, and remove them all at once. Use Scenarios: 1. In Windows 8, you can remove a single Windows Store App by right-clicking the tile in the Start menu and choosing the uninstall command.  However, no command is provided for removing multiple Windows Store Apps all at once. If you want to do so, you can use this script sample. 2. Sometimes Windows Store Apps may crash in Windows 8.  Even though you can successfully uninstall and reinstall the App, the application may still crash after the reinstallation.  In this situation, you can use this example script to remove these Windows Store Apps cleanly. Acknowledgement: Thanks Edward Qi from AIOSF for collecting the script idea and composing the script sample.  Thanks James Adams (Microsoft Premier Field Engineer) for reviewing the script sample and ensuring its quality.   This is just the beginning, and more and more script samples are coming.  You can follow our blog (http://blogs.technet.com/b/onescript) to get the latest customer-driven script samples for Windows Server 2012 and Windows 8.

    Read the article

  • How can I enable Gnome Shell Extensions with Ubuntu 11.10?

    - by TheGeeko61
    I am having a problem similar to that asked (and solved) here: Can't enable GNOME Shell extensions. I have performed both of the "tweaks" explained in that solution (i.e., here and here); but that does not seem to help. My gnome-shell is version 3.2.1. When I run gnome-tweak-tool from a shell, I get the following output: CRITICAL: Unknown extension error CRITICAL: Unknown extension error CRITICAL: Unknown extension error CRITICAL: Unknown extension error CRITICAL: Unknown extension error CRITICAL: Unknown extension error CRITICAL: Unknown extension error (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed (gnome-tweak-tool:7823): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width = 0' failed Has anyone actually solved this besides to the references above? I have made the suggested modifications from those sites.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >