Search Results

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

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

  • Retrieving a specific value from “df -h” using shell

    - by diegodias
    When I use df -h, I get the following output: Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 59G 2.2G 54G 4% / /dev/sda1 122M 38M 78M 33% /boot tmpfs 1.1G 0 1.1G 0% /dev/shm 10.10.0.105:/somepath 11T 8.4T 2.1T 81% /storage4 10.11.0.101:/somepath 15T 8.9T 5.9T 61% /storage1 /dev/mapper/patha 5.0T 255G 4.8T 5% /storage5_vol0 /dev/mapper/pathb 5.0T 195G 4.9T 4% /storage5_vol1 /dev/mapper/pathc 5.0T 608G 4.5T 12% /storage5_vol2 I want to write a script that gets the value of Avail column on a specific storage. I used to use df -k /storage_name | tail -1 | awk '{print $3}' But the FileSystem column can have a value or not .. which would change the variable of my script from $3 to $4. How can I get the Avail on a single command line even if there are no values on the previous columns?

    Read the article

  • Memeory Leak in Windows Page file when calling a shell command

    - by Arno
    I have an issue on our Windows 2003 x64 Build Server when invoking shell commands from a script. Each call causes a "memory leak" in the page file so it grows quite rapidly until it reaches the maximum and the machine stops working. I can reproduce the problem very nicely by running a perl script like for ($count=1; $count<5000; $count++) { system "echo huhu"; } It is independent of he scripting language as the same happens with lua: for i=1,5000 do os.execute("echo huhu") end I found somebody describing the same issue with php at http://www.issociate.de/board/post/454835/Memory_leak_occurs_when_exec%28%29_function_is_used_on_Windows_platform.html His solution: Firewall/Virus Scanner does not apply, neither are running on the machine. We can also reproduce the issue on other Developer Machines running XP 64, but not on XP 32 Bit. The guilty guy for the allocation is C:\WINDOWS\System32\svchost.exe -k netsvcs which runs all the basic Windows services. Does anybody know the issue and how to resolve it ?

    Read the article

  • Retrieving a specific value from "df -h" using shell

    - by Diego Dias
    When I use df -h, I get the following output: Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 59G 2.2G 54G 4% / /dev/sda1 122M 38M 78M 33% /boot tmpfs 1.1G 0 1.1G 0% /dev/shm 10.10.0.105:/somepath 11T 8.4T 2.1T 81% /storage4 10.11.0.101:/somepath 15T 8.9T 5.9T 61% /storage1 /dev/mapper/patha 5.0T 255G 4.8T 5% /storage5_vol0 /dev/mapper/pathb 5.0T 195G 4.9T 4% /storage5_vol1 /dev/mapper/pathc 5.0T 608G 4.5T 12% /storage5_vol2 I want to write a script that gets the value of Avail column on a specific storage. I used to use df -k /storage_name | tail -1 | awk '{print $3}' But the FileSystem column can have a value or not .. which would change the variable of my script from $3 to $4. How can I get the Avail on a single command line even if there are no values on the previous columns?

    Read the article

  • How to connect to a remote server and run some code on that particular server?

    - by seedeg
    I am implementing an automated backup scheme so I created a shell script which first creates SQL Dumps for all MySQL databases, then it retrieves all the websites from the /var/www of a remote server. The latter is working as I am using rsync to get the remote files. However, obviously, the MySQL dumps being retrieved are the ones on the local server which is not what I want. I want to get the SQL Dumps from the remote server as well. I have a tunnel between the local and remote server which I can connect without using any password (I added the public key to the authorized_hosts), so I tried to add the following code to the script: ssh [email protected] Then I tried to retrieve the SQL dumps and then I exit from the remote server. However this does not work as I still have to enter exit manually in the terminal for the SQL dumps to be retrieved from the remote host. I don't know why this is happening. Basically this is what the script is trying to do: //connect to remote server ssh [email protected] //retrieve SQL dumps //code to retrieve... //exit from remote server exit //use rsync to get remote files of /var/www from local server (working) Is there a way to connect to the remote host AND run the script's code ON THAT remote host? Many thanks in advance

    Read the article

  • Kill program after it outputs a given line, from a shell script

    - by Paul
    Background: I am writing a test script for a piece of computational biology software. The software I am testing can take days or even weeks to run, so it has a recover functionality built in, in the case of system crashes or power failures. I am trying to figure out how to test the recovery system. Specifically, I can't figure out a way to "crash" the program in a controlled manner. I was thinking of somehow timing a SIGKILL instruction to run after some amount of time. This is probably not ideal, as the test case isn't guaranteed to run the same speed every time (it runs in a shared environment), so comparing the logs to desired output would be difficult. This software DOES print a line for each section of analysis it completes. Question: I was wondering if there was a good/elegant way (in a shell script) to capture output from a program and then kill the program when a given line/# of lines is output by the program?

    Read the article

  • Shell extension for SharePoint libraries

    - by Toro
    Is there a shell extension for Windows Explorer that is optimized for SharePoint libraries. Expected features are: Displaying Check-in/check-out status (as an icon overlay or additional column) Context menu to allow check-in/check-out/undo check-out, etc. Displaying current document version number Displaying document version history

    Read the article

  • How can I invoke a function in bash shell script

    - by sufery
    !/bin/bash one_func(){ echo 'abcd' } echo $(one_func) echo one_func the end I just wonder the distinction calling the function between $(one_function) and one_function in bash shell script. When I set the variable "PS1" in ~/.bashrc, I can't invoke the function by one_func e: export PS1="\n[\e[31m]\$(one_func)" it work export PS1="\n[\e[31m]one_func" it doesn't work

    Read the article

  • "Abort" message on linux shell

    - by bksi
    hello i compile & run a C program in linux terminal (using gcc). the program recieves as an argument a text file, parses it and outputs to screen and/or another text file. for some reason. in some cases, when i run the program, i get "Abort" message on the shell, and i can't figure out why. does anyone have an idea why this happens? thanks

    Read the article

  • *nix shell with IOS style completion?

    - by Kyle Brandt
    Is there a Linux shell that will let you type less than full commands as you can with Cisco IOS, at least for the first command (and not its arguments)? I haven't really thought enough if this is actually a good thing, but might be fun to play with :-)

    Read the article

  • Alternative Windows shell?

    - by user17943
    I can't stand the Windows "shell". I can't copy text off a command prompt window, the .bat syntax is retarded, I can't stand how the command buffer works, it doesn't support ANSI color codes, I could go on and on. Are there any alternatives to the Windows command prompt (please, do not answer "Linux".)

    Read the article

  • Groff ignores line breaks from my shell

    - by Fred
    Hello, I've been using groff to make ps files for printing with the -man flag. If I want to convert anything else such as a header file or just the output from ls -l or other program the line breaks are ignored, producing a mess. How can I get groff to see and respect the line breaks in use in the shell?

    Read the article

  • Good Windows shell replacement [closed]

    - by Jazz
    I'm looking for a shell replacement for Windows, instead of Explorer. The features I'm looking at are: a task bar a tray bar an application launcher (I mostly use Launchy for that, but I need a launcher for those applications I forget the name...) The lighter and the easier to configure, the better! I'm currently using Emerge, but I found it a little buggy. I tried many others, but I never found something convincing.

    Read the article

  • Mac OS X - Could not start Terminal.app - shell has illegal value

    - by chemm
    I can not run the Terminal.app after rolling back my system from time machine. Mac OS X Version 10.6.2 It displays the following error. "Your are not authorized to run this application" "The administrator has set your shell to an illegal value" After that I have deleted the file ~/Library/Preferences/com.apple.Terminal.plist But the same message is displayed. I have repaired all system rights with the DiskUtility but that did not help.

    Read the article

  • HOw to enable shell login for particular user in one ip

    - by Master
    I have blocked FTP 21 port on server. NOw every connection will be via SFTP via ssh. Initially i had /etc/hosts.deny -- sshd:all But i had to remove that otherwise sftp was not working. How can i secure my shell login so that if someone login via root or userbac(root previleges) Then i need private key but not for other users Or any other to secure my system Thanks

    Read the article

  • Alternative Windows command shell and console?

    - by user17943
    I can't stand the Windows command "shell" and console window. I can't copy text off a command prompt window, the .bat syntax is retarded, I can't stand how the command buffer works, it doesn't support ANSI color codes, I could go on and on. Are there any alternatives to the Windows command prompt?

    Read the article

  • Use of hyphen in shell command

    - by deanloh
    I feel shy to ask this question, but if I don't I will never know, so here I am giving it a shot: I notice most shell commands use "-" for options, but I also noticed some commands do not have it. For example, to archive files in a given direct, the command is: tar czvf allmyfiles.tar.gz * However, to extract an archive, the command I learned, is: tar -zxvf allmyfiles.tar.gz Looking at both examples above, is there any significance whether to include the hyphen or not?

    Read the article

  • Remove duplicated images with the shell [duplicate]

    - by nkint
    This question is an exact duplicate of: Find all duplicate files by md5 hash 1 answer I have a folder with osme images. Each of them has a different name but some of them are duplicate. What is the best way to delete the duplicates? I have to do it sistematically so I need some shell command/script to invoke. No limitation of used software, just no strange software.. I'd like to do it both in a Mac and in a Ubuntu systems

    Read the article

  • Korn Shell code to send attachments with mailx and uuencode?

    - by Nano Taboada
    I need to attach a file with mailx but at the moment I'm not having a lot of success. Here's my code: subject="Something happened" to="[email protected]" body="Attachment Test" attachment=/path/to/somefile.csv uuencode $attachment | mailx -s "$subject" "$to" << EOF The message is ready to be sent with the following file or link attachments: somefile.csv Note: To protect against computer viruses, e-mail programs may prevent sending or receiving certain types of file attachments. Check your e-mail security settings to determine how attachments are handled. EOF Any feedback would be highly appreciated. Update I've added the attachment var to avoid having to use the path every time.

    Read the article

  • bash : "set -e" and check if a user exists make script exit

    - by Dahmad Boutfounast
    i am writing a script to install a program with bash, i want to exit on error so i added "set -e" in the beginning of my script. the problem is that i have to check if a user exists inside of my script, to do this i am using "grep "^${USER}:" /etc/passwd", if the user exists, the script runs normally, but if the user doesn't exist, this command exists, and i don't want to exit on this case (i have to create the user and continue my installation). so what's the solution to make my script continue running ?? i tried to redirect the output of "grep" to a variable, but i still have the same problem :( thanks.

    Read the article

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