Search Results

Search found 24505 results on 981 pages for 'bash script'.

Page 21/981 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • BASH - Run command for each line in output of previous command

    - by user1582375
    All, I am want to request all network services using: networksetup -listallnetworkservices I then want to run the below command for each line in produced from the above command: networksetup -setautoproxyurl "A LINE FROM ABOVE" http://etc... Adiitonally, I only want to issue the setautoproxyurl command for service with "Ethernet" or "Wi-Fi" in the name networksetup -listallnetworkservices | while read line; do networksetup -setautoproxy $line http://etc...

    Read the article

  • What to do when you can not type a letter in Cygwin/bash

    - by Stenemo
    I had a very strange issue that happened as I was editing .bashrc or possible .profile, which made it impossible to press the letter "a" (it is not showing up on screen, although I am able to type it in all other programs as usual. I am not sure, but I was trying to get aliases to work on my computer at the time, so it is possible that I somehow aliased a to "", although I am not sure how that would have happened. I solved this by copying all the files in "cygwin\etc\skel\" (these are the backup starting files in case you ever need to replace them) into my home folder. Just leaving this question here so that other people which run into the same problem know what to do, not sure why I am unable to press "solve your question" at the moment, but I hope that someone who reads this knows how to edit this question so that the next person with this problem knows what to do. Also, not sure if this belongs in this forum or another one, but guess it is more of a unix question.

    Read the article

  • (Mac Terminal) Looking for a recommendation for a BASH manual

    - by Mental Sticks
    Hi, I've just begun to use the Terminal in Mac OS X and I've found the 'man' command very useful, although very often the explanations are too compact or complicated for me. I am looking for a very basic reference guide – like O'Reilly makes, for example. But in there I didn't find an entry for basic commands like ls or ln and a layman's explanation of all the flags and options. Could anybody recommend me something? Thansk a bunch in advance

    Read the article

  • bitwise XOR a string in Bash

    - by ricky2002
    Hi. I am trying to accomplish a work in Bash scripting. I have a string which i want to XOR with my key. #!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH teststring="abcdefghijklmnopqr" Now how do i XOR the value of teststring and store it in a variable using bash? Any help will be appreciated.

    Read the article

  • Read a variable in bash with a default value

    - by rmarimon
    I need to read a value from the terminal in a bash script. I would like to be able to provide a default value that the user can change. # Please enter your name: Ricardo^ In this script the prompt is "Please enter your name: " the default value is "Ricardo" and the cursor would be after the default value. Is there a way to do this in a bash script?

    Read the article

  • hex dump of file in bash

    - by David Raswik
    How do I create a UNMODIFIED hex dump of a binary file in linux with bash? The od and hexdump commands both insert spaces in the dump, I DON'T WANT THIS, I need something that will simply write a long string with all the hex characters without inserting spaces or newlines in the output. How do I do this in bash?

    Read the article

  • Bash: Correct way to Iterate over Map

    - by Lars Tackmann
    In Bash I can create a map (hashtable) with this common construction hput() { eval "$1""$2"='$3' } hget() { eval echo '${'"$1$2"'#hash}' } and then use it like this: hput capitols France Paris hput capitols Spain Madrid echo "$(hget capitols France)" But how do I best iterate over the entries in the map ?. For instance, in Java I would do: for (Map.Entry<String, String> entry : capitols.entrySet()) { System.out.println("Country " + entry.getKey() + " capital " + entry.getValue()); } is there a common way of accomplishing something similar in Bash ?.

    Read the article

  • Listing defined functions in bash

    - by Charles Duffy
    I'm trying to write some code in bash which uses introspection to select the appropriate function to call. Determining the candidates requires knowing which functions are defined. It's easy to list defined variables in bash using only parameter expansion: $ prefix_foo="one" $ prefix_bar="two" $ echo "${!prefix_*}" prefix_bar prefix_foo However, doing this for functions appears to require filtering the output of set -- a much more haphazard approach. Is there a Right Way?

    Read the article

  • bash: expanding variables with spaces

    - by adam n
    i have a file called physics 1b.sh in bash, if i try x="physics 1b" grep "string" "$x".sh grep complains: grep: physics 1b: No such file or directory. However, when i do grep "string" physics\ 1b.sh it works fine. So i guess the problem is something to do with the variable not being expanded to include the backslash that grep needs to recognize the space. How do i get this to work? using bash 3.2, mac os 10.6.

    Read the article

  • Embed bash in python

    - by Werner
    Hi, I am writting a python script and I am running out of time. I need to so some things that I know pretty well in bash, so I just wonder how can I embed some bash lines into a python script. Thanks

    Read the article

  • Bash and sort files in order

    - by Werner
    Hi, with a previous bash script I created a list of files: data_1_box data_2_box ... data_10_box ... data_99_box the thing is that now I need to concatenate them, so I tried ls -l data_* but I get ..... data_89_box data_8_box data_90_box ... data_99_box data_9_box but I need to get in the sucession 1, 2, 3, 4, .. 9, ..., 89, 90, 91, ..., 99 Can it be done in bash?

    Read the article

  • converting bash script to .bat

    - by Robokop
    #!/bin/bash function usage(){ cat <<EOF USAGE: $0 [strategylist] valid strategies are: ALLD ALLC TitForTat JOSS WeightedRandom Tester EOF exit 1 } [ -z $1 ] && usage javac robsAgents/*.java robsAgents/behaviours/*.java agentlist='leader:robsAgents.TournamentLeader' agentlist=$agentlist";$1:robsAgents.Contestant" while shift; do agentlist=$agentlist";$1:robsAgents.Contestant" done java jade.Boot -gui -host 127.0.0.1 "$agentlist" i have above bash script and have no access to a windows computer and i need to convert it to a .bat file, but don't even know how to do the shift and argument parsing

    Read the article

  • what does '-' stand for in bash?

    - by trybeingarun
    Hi, What exactly are the uses of '-' in bash? I know they can be used for 1. cd - # to take you to the old 'present working directory' 2. some stream generating command | vim - # somehow vim gets the text. My question is what exactly is - in bash? In what other contexts can I use it? Regards Arun

    Read the article

  • Bash, no-arguments warning, and case decisions

    - by Werner
    Hi, I am learning bash. I would like to do a simple script that, when not arguments given, shows some message. And when I give numers as argument,s depending on the value, it does one thing or another. I would also like to know suggestions for the best online manuals for beginners in bash Thanks

    Read the article

  • Parse contents of directory to bash command in a script

    - by ECII
    I have the directory ~/fooscripts/ and inside there are foo1.txt, foo2.txt, etc etc I have a command that takes the file foo1.txt as input and does some calculation. The output location etc is handled internally in fooprog fooprog -user-data=foo1.txt I would like to automate the whole thing in a bash script so that the script will parse all txt files in ~/fooscripts/ sequentially. I am a newbie in bash. Could anyone give me a hint?

    Read the article

  • find: missing argument to -exec in bash script

    - by Mephi_stofel
    The following works fine when I type it exactly in the command line: find /<some_path>/{epson,epson_laser,epson_inkjet} -iname "*.ppd" -exec grep "\*ModelName\:" {} \; | sed 's/.*\"\(.*\)\"/\1/' However, when I try to call the following from a bash script I get find: missing argument to -exec'. I have also tried the following (in many variants): eval find "$1" -iname "*.ppd" -exec 'bash -c grep "\*ModelName\:" "$1" | sed "s/.*\"\(.*\)\"/\1/" \; as was mentioned in find-exec-echo-missing-argument-to-exec.

    Read the article

  • Don't know why this small shell script wont work

    - by tominated
    Hi, I'm trying to make a small script to start up gunicorn for a python website I'm making. I have modified the script found at https://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc slightly. Here's my version. #!/bin/sh GUNICORN=/usr/local/bin/gunicorn ROOT=/srv/mobile-site/app PID=/var/run/gunicorn.pid APP=mobilecms:app if [ -f $PID ]; then rm $PID fi cd $ROOT exec $GUNICORN -b 127.0.0.1:8080 -w 8 -k gevent --pidfile=$PID $APP When I try to run the script though, it shows this error /etc/init.d/gunicorn: 13: Syntax error: end of file unexpected (expecting "fi") Does anyone know what's wrong?

    Read the article

  • Chrome browser full Kiosk mode in Linux (Puppy Linux)

    - by Brandon Ellis
    Let me just say thanks in advance. I am having issues getting google-chrome browser into full KIOSK MODE with no browser bar on a linux platform Looking through the google forums I have found numerous postings on how to get Chrome to show full kiosk mode BUT tried to execute with --kiosk but doesnt seem to get the job done. I dont know if this is platform specific or not, but any useful information would help. I know F11 will display the browser in full kiosk mode, with no browser bar BUT is there a way to do this with a linux script and no need for a monkey pressing F11??

    Read the article

  • Can I find which script outputs which error?

    - by ibrahim
    There is a script which calls other scripts and they call others... I don't know exactly which scripts are called and how many of them. I only know that some of them are adding iptables rules and I get this error when I call root script. iptables: No chain/target/match by that name. iptables: No chain/target/match by that name. My problem is that I can not find which script outputs this errors. Is there any way or tool to learn that?

    Read the article

  • Trying to script rsync using pam_exec

    - by Ricky-Rose
    I'm trying to write a bash script that will execute rsync when called by pam_exec. I've tried a couple different ways, and I'm not sure what I'm doing wrong. When I try to run the script at login by adding session optional pam_exec.so /usr/bin/local/sync.sh to my sshd file, it gives me an exit code of 12. if I log in and then manually run my script, it allows me to connect to the remote server, and it lists my files, but it doesn't actually sync anything. I have tried the code below using buth $USER and $PAM_USER. $PAM_USER doesn't work at all. #!/bin/sh rsync -azv -e ssh $USER@remote_server:/home/html/$USER/ /home/html/$USER

    Read the article

  • What is wrong with my expect script?

    - by Bryan
    I'm trying to learn how to use the expect command, to help me automate deployment of some software via shell scripts, and figured I start with something simple to get me started. I've created a file in my home dir called 'foo' using: touch foo And I've created the following script saved as test.exp #!/usr/bin/expect spawn rm -i foo expect "rm: remove regular empty file `foo'?" send "y\r" When I run the script using ./test.exp, it spawns the rm command, but it doesn't appear to send the Y and carriage return. I know I don't have a typo in the expect string, as I've used copy and paste to put in the script. What am I doing wrong?

    Read the article

  • Why doesn't this script work?

    - by Devin
    I've been using this bash script: for i in $(ls); do mv $i a$i; done to prepend all filenames in a folder with the letter a. I'm afraid that at some point I'll accidentally use this script in the wrong directory and prepend a ton of filenames that I don't want prepended. So I decided to explicitly cite the path to the file. So now my script looks like this: for i in $(ls /cygdrive/c/Users/path/to/Images); do mv /cygdrive/c/Users/path/to/Images/$i /cygdrive/c/Users/path/to/Images/a$i; done It does prepend the filename with the letter a, but it also appends the filename with this ? symbol. Any ideas why it would do that? If it helps any, I'm using cygwin on a Windows 7 box. Thanks for the help!

    Read the article

  • add script on boot linux machine

    - by user1546679
    I have one script to start a service on my ubuntu. I added it on boot machine using "# update-rc.d projeto defaults". But it still doesn't start with the boot machine. I think is because I am using other user to start the script "su - www-data -c ...". But I am not sure, because I run the update-rc.d command as root. When I execute the script from a terminal, it asks the password of the user www-data. Does anyone know what is happening? Thanks a lot! Felipe #!/bin/bash # /var/www/boinc/projeto/bin/start function action { su - www-data -c "/var/www/boinc/projeto/bin/$1" } case $1 in start|stop|status) action $1 ;; *) echo "ERRO: usar $0 (start|stop|status)" exit 1 ;; esac

    Read the article

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