Search Results

Search found 5884 results on 236 pages for 'bash scripting'.

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

  • Bash command that prints a message on stderr

    - by Salman A
    I want to know if there is a built-in BASH command that prints some text on stderr, just like the echo command that prints text on stdout. I don't want to use temporary io-redirection. I use a built-in command to generate an error on stderr such as ls --asdf (ls: unrecognized option '--asdf') but I want something neater,

    Read the article

  • Simple bash scripting

    - by Richard Cotton
    I'm trying to get to grips with bash scripting via cygwin. My script is about as simple as it gets. I change the directory to the root of my C drive, and print the new location. #!/usr/bin/bash cd /cygdrive/c pwd is saved in the file chdir.sh in my home directory. I then call ./chdir.sh from the bash prompt. This results in the error : No such file or directorygdrive/c /cygdrive/c/Documents and Settings/rcotton I definitely have a C drive, and the command cd /cygdrive/c works when I call it directly from the bash prompt. I realise that this problem is likely stupidly simple; please can you tell me what I'm doing wrong.

    Read the article

  • Trouble editing ~/.bash_profile: -bash: $'\r': command not found

    - by Dave
    I installed CygWin on Windows 7. Using Notepad, I edited my ~/.bash_profile file to add on to the PATH variable … PATH="${PATH}:/cygdrive/c/apache-ant-1.8.2/bin" Now, when I SSH in to my Windows machine, I get this error … -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: /home/dev/.bash_profile: line 39: syntax error: unexpected end of file and my PATH is not set. Anyone know how I can correct this?

    Read the article

  • Configure Console2 to open bash in current folder

    - by davidkennedy85
    I've seen this but it doesn't work for me. I'm not using Git's version of bash but the one that comes with cygwin, so that could be part of the problem. Here is how I have my tab in Console2 set up: Title: bash.exe Shell: C:\cygwin\bin\bash.exe --login -i Startup dir: %HOMEDRIVE%%HOMEPATH% This is my registry entry: Directory shell Console2 Open Console2 Here command "C:\Console2\Console.exe" -d "%1" bash always starts in my home directory instead of the directory I'm clicking on, then I have to cd /cygdrive/d/code ... etc. I tried removing the value in the "Startup dir" field, changing it to %1, %1% with no luck. I also tried this solution but it didn't work for me either: Title: bash.exe Shell: C:\cygwin\bin\bash.exe -l Registry: Directory shell Console2 Open Console2 Here command "C:\Console2\Console.exe" -d "%V" .profile file in root directory: cd - Any ideas?

    Read the article

  • How to make bash quit tab autocompleting hidden directories

    - by Kristopher Micinski
    Most of the time, I don't need autocompletes for my hidden directories. In fact, that's the point of them being hidden! However, annoyingly, bash takes these directories into account when considering tab autocompletion. This is particularly annoying when I have the following scenario: a .svn foler along with a single folder that I want to traverse into by simply pushing tab. (This typically comes up with deep Java packages...) Is there any way to change the default behavior? Worst case scenario I have to type '.' before tab, which seems like a no brainer for my usability.

    Read the article

  • Making a bash script that reconnect to AP when connection lost

    - by Alexander
    I'm facing problems with WIFI on ubuntu i tried to update the system but still the same what happens is that i suddenly lose the connection with my router and when i press on the WIFI bar the system won't detect any APs i have to uncheck "enable WIFI" option ,then re check it so it work,it automatically reconnect. I'm thinking of making a bash script that detects when the pc is disconnected from the router for any reason, and when it is disconnected it disable then enable the wifi. i mean like automating resetting the connection that possible ? i guess i must use this nmcli nm wifi off nmcli nm wifi on but how can i make the script know if the PC is disconnected from the WIFI ?

    Read the article

  • How to escape this in the bash script?

    - by allenskd
    I'm trying to complete a batch of 3 videos to leave it there till morning processing but it seems there are special characters in it... I try it "raw" in the terminal and it works but in bash script it stops working Example: args1="-r 29.97 -t 00:13:30 -vsync 0 -vpre libx264-medium -i" args12="-r 29.97 -ss 00:40:30 -vsync 0 -vpre libx264-medium -i" args2="[in] scale=580:380 [T1],[T1] pad=720:530:0:50 (other arguments with lots of [ and ]" In the output it says Unable to find a suitable output format for 'scale=580:380' not sure why... like I said, the command runs fine in the command-line, just not in the script /usr/local/bin/ffmpeg "$args1" "${file}" -vf "$args2" "$args3" "${args[0]}_${startingfrom}_0001_02.mp4"

    Read the article

  • A problem with Bash script

    - by c.sokun
    I want to write a simple script to detect a file created by Windows virus, usually it create an .exe file with the same name as the directory it drop. Here is the script it only work if the path name doesn't contain \n. Can someone help me fix this script please! #!/bin/bash if [ $# == 0 ]; then echo "" echo "==== Give me a directory to begin with! ====" echo "" exit fi for f in `find $1 -name '*.exe'` | do filename=`basename "$f" .exe` dir_name=`dirname "$f"` current_dir_name=`basename "$dir_name"` if [ $filename == $current_dir_name ]; then rm -f "$f" # It can't remove file where path contain space or \n ??!! fi done

    Read the article

  • Bash does not remember programs with non 0 exit status in history

    - by Amigable Clark Kant
    I enter a command. It fails. I press arrow up, modify something and enter it again ... hold it right there. It used to work like that. Now it's more like: I enter a command. It fails. I press arrow up, get the last command which didn't fail, likely "ls" or something useless and I type the whole thing again back by hand. What happened? It wasn't always like this. But it's quite some time since this behavior changed, I'll give you that. Some years ago, at least. How do I put some sanity back into my bash prompt?

    Read the article

  • Sendmail not working as desired in bash script

    - by dan08
    This is the code I have in a bash script that runs as a cronjob. The cronjob run as root. /usr/sbin/sendmail [email protected]<<EOF subject:Backup Error! from:backup@server01 $error EOF There is code after this and the email I get is as follows: From the root user on the machine. and the message includes: subject:Backup Error! from:backup@server01 $error EOF More code... that is in the script all the way to the end... I have tried other variations, this is the closest I've got. I tried this in a regular script and it worked properly. Whats going on, and how can I send this email, specifying the subject and form sender?

    Read the article

  • bash-completion for xelatex

    - by andreas-h
    I'm on Ubuntu 12.04. When using bash as my shell, I can just type latex my_do <TAB> to compile a file my_document.tex, as *bash_completion* does the auto-complete. However, this auto-completion does not work for the xelatex executable. So I would like to add the same auto-complete functionality for xelatex as exists for latex. I could find that the latex auto-complete feature comes from the file /etc/bash_completion, where I could find a line complete -f -X '!*.@(?(la)tex|texi|dtx|ins|ltx)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi Now I could of course just add xelatex to that line and everything is fine. However, I'm wondering if I could instead put a file in /etc/bash_completion.d, as this would leave the system file untouched. Unfortunately, I'm at a complete loss about the syntax -- but maybe someone can help me here?

    Read the article

  • bash script to login to webpage

    - by Nathan Cazell
    I am trying to login into this page but I cannot for the life of me get it to work. I have to login to this site when i connect to my school's wifi in order to start a session. So far ive tried to use bash and cUrl to achieve this but have only achieved to give myself a headache. will cUrl work or am I on the wrong track? Any help is greatly appreciated! Thanks, N Here's what i tried: curl --cookie-jar cjar --output /dev/null http://campus.fsu.edu/webapps/login/ curl --cookie cjar --cookie-jar cjar \ --data 'username=foo' \ --data 'password=bar' \ --data 'service=http://campus.fsu.edu/webapps/login/' \ --data 'loginurl=http://campus.fsu.edu/webapps/login/bb_bb60/logincas.jsp' \ --location \ --output ~/loginresult.html \ http://campus.fsu.edu/webapps/login/

    Read the article

  • What defines a language as a scripting language? [closed]

    - by Mathew Foscarini
    Possible Duplicate: What is the main difference between Scripting Languages and Programming Languages? I'd like to know what defines a language as a scripting language compared against other programming languages. Some possible scripting languages might include AutoCad LISP, Linux Bash, DOS Batch, Javascript or ActionScript in Flash. Where is the distinction made that makes a language a scripting language? Are there a set of clearly define rules to classify it as such?

    Read the article

  • bash script move file to folders based in name

    - by user289111
    I hope you can help me... I made a perl and bash script to make a backup of my firewalls and tranfers via tftp #!/bin/sh perl /deploy/scripts/backups/10.160.23.1.pl > /dev/null 2>&1 perl /deploy/scripts/backups/10.160.23.2.pl > /dev/null 2>&1 so this tranfers the file to my tftp directory /tftpboot/ ls -l /tftpboot/ total 532 -rw-rw-rw- 1 tftp tftp 209977 jun 6 14:01 10.160.23.1_20140606.cfg -rw-rw-rw- 1 tftp tftp 329548 jun 6 14:02 10.160.23.2_20140606.cfg my questions is how to improve my script to moving this files dynamically to another folder based on the name (in this case on the ip address) for example: 10.160.23.1_20140606.cfg move to /deploy/backups/10.160.23.1/ is that the answer to this surely was on Google, but wanted to know if there was a particular solution to this request and also learn how to do :) Thanks!

    Read the article

  • Translating to Bash Command

    - by user3424684
    So for a project for school I had to install the DPJ extension to the Java language. I downloaded and unpacked a tarball containing the files, and then was told to run the following: setenv DPJ_ROOT ${Home}/dpjbin setenv PATH ${PATH}:${DPJ_ROOT}/Implementation/bin How do I do these commands using bash? I know I have to open up the /etc/profile file and add 2 lines (or for the PATH one do I just append something to the top line of the file after a colon?). Any help in how to do this would be appreciated. If it helps I run Ubuntu 14.04 on Virtualbox (and have little to no experience)

    Read the article

  • When would I use "scripts" or "scripting" in a game, as opposed to the core language?

    - by Brian Reindel
    The terms scripts and scripting appear to be used interchangeably on the Game Development Stack Exchange, but other than reading questions about a scripting language choice, I don't understand the relationship between scripts and scripting, and the core language. What does a script typically do, when would it be used, and are scripts in some contexts (as defined by game programmers) different than a scripting language?

    Read the article

  • How to encourage Windows administrators to pick up scripting

    - by icelava
    When i worked as an administrator in my first job, I was frustrated our administration processes with Windows servers were a series of point-and-clicks; we could never match the level of efficiency with the Unix servers which had a group of shell scripts to automate a lot of the work. I soon read about WSH and ADSI and wasted no time learning just how much automation I was able to achieve with scripting. There was a huge problem though - almost none of my Windows colleagues were really interested in learning scripting. They seemed happy with the manually mouse-clicking chores and were never excited at the prospect of using scripts to do the work on their behalf. I struggled to convince them to pick up scripting skills despite the evident increases in efficiency. I left that job in pursuit of a full-time software development career thereafter. Almost a decade on working in various environments and different customers, I still encounter Windows administrators mainly possessing this general "mood" where they would avoid scripting as much as possible. Despite the increasing level of accessibility Windows server technologies are opening up for scripting and automation. I am almost certain the majority of administrators are administrators precisely because they absolutely hate performing any kind of programming duties. What are some means to encourage and motivate administrators that scripting can really help them in the long run?

    Read the article

  • needing storage integrity (write/read) test - for BASH

    - by Mr. Bash
    In need of shell scripts / bash commands to verify data integrity of local harddrives, usb-drives, etc, ... Like the famous www.heise.de/download/h2testw; or something that is at least common within repositories. (h2testw writes a specific datastring over and over onto the medium, then reads it again to verify if it was written correctly and displays write/read time/speed.) please no dd if=/dev/random of=/dev/sdx bs=1k && dd if=/dev/sdx of=/dev/null bs=1k since it won't verify if everything was written correctly. It is only a test if read/write is successful to the device. So far, I'm not too happy with badblocks -w -v /dev/sdx1 either, since it seems rather slow and I don't know what it exactly writes, and if it considers wear-leveling on flash media. There is also a program named F3 http://oss.digirati.com.br/f3/ that needs to be compiled. Designed after h2testw, the concept sounds interesting, i'd just rather have it as a ready to go bash script.

    Read the article

  • Problem executing bash file

    - by sandelius
    HI there! I've run into some problem while learning to combine .sh files and PHP. I've create a file test.sh and in that file I call a PHP file called test.php. If I double click on the .sh file then it runs perfectly but when I try to run it from the terminal I get "command not found". I'm in the exact folder as my .sh file but it wont work. Here's my test.sh: #!/bin/bash LIB=${0/%cli/} exec php -q ${LIB}test.php one two three exit; When I doubleclick on the test.sh file then it returns the argv array like it suppost to. But why can't I run it from terminal?

    Read the article

  • Automatic exit from bash shell script on error

    - by radman
    Hi, I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example: #!/bin/bash cd some_dir ./configure --some-flags make make install So in this case if the script can't change to the indicated directory then it would certainly not want to do a ./configure afterward it fails. Now I'm well aware that I could have an if check for each command (which I think is a hopeless solution), but is there a global setting to make the script exit if one of the commands fails?

    Read the article

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