Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 62/271 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • tail -f updates slowly

    - by Cliff
    I'm not sure why, but on my Macbook Pro running lion I get slow updates when I issue "tail -f" on a log file that is being written to. I used to use this command all the time at my last company but that was typically on Linux machines. The only thing I can think of that would possibly slow the updates are buffering of output and/or maybe a different update interval on a Mac vs. Linux. I've tried with several commands all which write to stout relatively quickly but give slow updates to the tail command. Any ideas? Update I am merely running a python script with a bunch of prints in it and redirecting to a file vi " my output.log". I expect to see updates near real time but that doesn't seem to be the case.

    Read the article

  • Colored PS1 string

    - by Will Vousden
    Clarification: I want __foo to be executed each time the PS1 string is presented in the terminal, not when the PS1 string is constructed (hence its being in quotes). __foo contains logic that examines the current directory, so its execution must be deferred. I'm trying to use different colours in my Bash PS1 string from within a Bash function: LIGHTRED="\033[1;31m" LIGHTGREEN="\033[1;32m" RESET="\033[m" __foo () { # Do some stuff and genereate a string to echo in different colours: echo -n '\['$1'\]firstcolour \['$2'\]secondcolour' } PS1='$(__foo '$LIGHTRED' '$LIGHTGREEN')\['$RESET'\] \$' Essentially I want __foo to generate part of the PS1 in a bunch of different colours. My attempt doesn't seem to work, though; it produces the following output: -bash: 31m: command not found -bash: 32m: command not found \[]firstcolour \[\]secondcolour $ What gives, and how can I fix it?

    Read the article

  • How do I teach my command line manners?

    - by Sam152
    Whenever I complete something in the command line while using Ubuntu and my computer does something of value to me, I enjoy saying thank you, just because it's the polite thing to do. A typical conversation might look something like this: mtp-sendfile HamishAndyPodcast.mp3 /Music/podcasts Sending file... Progress: 17769768 of 17769768 (100%) New file ID: 76098 sam@sams-laptop:~$ thanks thanks: command not found What's the best way to teach my PC a few manners and respond with something like "No problemo".

    Read the article

  • While loop read multiple lines from a grep

    - by Basil
    I'm writing a script in AIX 5.3 that will loop through the output of a df and check each volume against another config file. If the volume appears in the config file, it will set a flag which is needed later in the script. If my config file only has a single column and I use a for loop, this works perfectly. My problem, however, is that if I use a while read loop to populate more than one variable per line, any variables I set between the while and the done are discarded. For example, assuming the contents of /netapp/conf/ExcludeFile.conf are a bunch of lines containing two fields each: volName="myVolume" utilization=70 thresholdFlag=0 grep volName /netapp/conf/ExcludeFile.conf | while read vol threshold; do if [ $utilization -ge $threshold ] ; then thresholdFlag=1 fi done echo "$thresholdFlag" In this example, thresholdFlag will always be 0, even if the volume appears in the file and its utilization is greater than the threshold. I could have added an echo "setting thresholdFlag to 1" in there, see the echo, and it'll still echo a 0 at the end. Is there a clean way to do this? I think my while loop is being done in a subshell, and changes I make to variables in there are actually being made to local variables that are discarded after the done.

    Read the article

  • Check a list of passwords strength

    - by user144705
    Is there any way to check a list of passwords whether they strong or not? I have a list of passwords, around 2000, and want to check them against this policy Password must contain a minimum of eight (8) characters Password must contain at least one letter Password must contain at least one number Password must contain at least one punctuation character And count how many compliant with that policy before we save them. Is there any tool, script or maybe rules in excel to do this instead of doing it manually? Could you please help me?

    Read the article

  • Advanced merge directory tree with cp in Linux

    - by mtt
    I need to: Copy all of a tree's folders (with all files, including hidden) under /sourcefolder/* preserving user privileges to /destfolder/ If there is a conflict with a file (a file with the same name exists in destfolder), then rename file in destfolder with a standard rule, like add "old" prefix to filename (readme.txt will become oldreadme.txt) copy the conflicted file from source to destination Conflicts between folders should be transparent - if same directory exists in both sourcefolder and destfolder, then preserve it and recursively copy its content according to the above rules. I need also a .txt report that describes all files/folders added to destfolder and files that were renamed. How can I accomplish this?

    Read the article

  • How do I perform commands in another folder, without repeating the folder path?

    - by Valter Henrique
    Is there a clever way to do copy and move operations or a command to duplicate a file, without having to do a cd, then mv after, at the same folder? For example, I have to run the following: mv /folder1/folder2/folder3/file.txt /folder1/folder2/folder3/file-2013.txt Note that the directory to where I'm moving the file is the same, but I have to put the whole path again and sometimes it gets annoying. I'm curious to know if there's another way to do that without having to put the whole path again, because the operation would be done in the same path.

    Read the article

  • update terminal title from standard output of long running command?

    - by Sam Hasler
    I'd like to change the title of a terminal window during a long running command (for example: git svn fetch) with values greped from the output, whilst still writing to standard output. Is this possible using named pipes or tee and xargs? I'm thinking something like git svn fetch | sed "s/^\(r\d*\).*$/ \"\\\033]0;\"\1\"\\\007\"/" | xargs -l1 echo -ne based on: http://tldp.org/HOWTO/Xterm-Title-3.html Update: getting this to work would be enough: (echo "r9" ; echo "r10") | sed "s/^\(r\d*\).*$/ \"\\\033]0;\"\1\"\\\007\"/" | xargs -l1 echo -ne Update 2: This almost does what I want. I see r10, but not r9: (echo "r9" ; sleep 1 ; echo "r10") | sed "s/^\(r[0-9]*\)\.*$/\\\033]0;\1\\\007/" | xargs -0 echo -ne

    Read the article

  • Simple dig output?

    - by knocte
    In a script I want to be able to write an IP address to somewhere easily, so I thought using dig (or a similar command) with back-ticks. However the simplest output I've been able to come up to wrt dig parameters is > dig -t A +noall +answer www.google.com www.google.com. 300 IN A 173.194.66.106 www.google.com. 300 IN A 173.194.66.104 Any way (extra arg, different tool instead of dig?) to get rid of the junk apart from the IP address?? (And please don't tell me to use sed.) Thanks

    Read the article

  • command line find/replace help

    - by Chrisbloom7
    I've got a set of 5000+ files that I need to do a simple search and replace in. I have been doing it in a text editor (EditPlus) by opening 500 files at a time, doing a global search/replace, saving all, closing, etc. But, that's taking literally hours to do and it's boring and tedious and I already have done it once today and need to do it again because all the files got refreshed. Is there a way to do this via the Bash command line? Here's the details: Find onchange="document.location ='/products/view.html/view/'+this.value" Replace it with onchange="alert('Not implemented')" style="display: none" All of the files have a .HTM extension, but they are nested in several sub directories.

    Read the article

  • Force '^C' to be printed when editing current prompt, then aborting it

    - by Stefan Lasiewski
    This is the opposite of Prevent “^C” from being printed when aborting editing current prompt. I'm using Bash. When I'm editing the commandline in Bash, and I hit Control-C to abort the commandline, the '^C' character does not display. I would like to see this character. I tried commands like stty -ctlecho and stty ctlecho (which I borrowed from the other question), but this didn't work for me. This behavior seems to be true with my environment on Ubuntu, CentOS and MacOSX.

    Read the article

  • How to delete files on the command line with regular expressions?

    - by Jack
    Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, eg rm FOO0* However, if I want to delete specific files ina range, eg 13-15, this becomes more difficult. rm FPP[13-15] does not work, and asks me if I wish to delete all files. Likewse rm FOO1[3-5] wishes to delete all files that begin with FOO1 So, what is the best way to delete ranges of files like this? I have tried with both bash and zsh, and I don't think they differ so much for such a basic task?

    Read the article

  • Selectively delete entries from Windows 7 autocomplete history dropdown box

    - by kez
    Random question, and I'm sure it has a very simple answer, if not already asked and answered in some shape or form. How do you selectively delete entries from the autocomplete history dropdown thingy? For example, in the Run dialog box, typing a few letters will display a dropdown box with a history of matchine entries that you have previously run. I swear I used to be able to delete from the list by using the arrow keys to highlight and then press the DEL key. Regardless of whether this is true or not, is there any way to selectively delete entries from this list? Another example is the dropdown list in the Remote Desktop Connection dialog box.

    Read the article

  • Diff 2 files while ignoring parts of lines

    - by Millianz
    I would like to diff a file system. Currently my bash script prints out the file system recursively into a file (ls -l -R) and diffs it with an expected output. An example for a line in this file would be: drw---- 100000f3 00000400 0 ./foo/ My current diff command is diff "$TEMP_LOG" "$DIFF_FILE_OUT" --strip-trailing-cr --changed-group-format='%' --unchanged-group-format='' "$SubLog" As you can see I ignore additional lines in the current output file, I only care about lines that match with the master output. I now have the problem though that some files may differ in size, or a folder might even have a different name, but due to it's location I know what access rights it should have. For example: Output: ------- 00000000 00000000 528 ./foo/bar.txt Master: ------- 00000000 00000000 200 ./foo/bar.txt Only the size differs here, and it doesn't matter, I would like to just ignore certain parts of the diff, kind of like an ansi c comment. Master: ------- 00000000 00000000 /*200*/ ./foo/bar.txt -- OR -- Master: d------ 00000000 00000000 /*10*/ ./foo//*123123*///*76456546*//bar.txt Output: d------ 00000000 00000000 0 ./foo/asd/sdf/bar.txt And still have it diff correctly. Is this even possible with diff, or will I have to write a custom script for it? Since I'm fairly new to cygwin I might be using the completely wrong tool all together, I'm happy for any suggestions. Update: Taking a step back, here is the general task at hand that I want to achieve. I want to write a script that checks the file system to see if the read/write permissions are set up correctly. The structure of the file system is under my control, so I don't have to worry about it changing too much. Sometimes folders/files might not be present, but if they are their permissions must be checked. For Example assume that the following is a snapshot of the current file system structure drw ./foo drw ./foo/bar -rw ./foow/bar/bar.txt drw ./foo/baz -rw ./foo/baz/baz.txt And this is what the file system structure might dictate, i.e. if these folders / files are present, the permissions must match. drw ./foo drw ./foo/bar -rw ./foo/bar/bar.txt --- ./foo/bar/foobar.txt drw ./foo/baz -rw ./foo/baz/foobaz.txt In this case the file system checked out ok, since all files present match their expected values. The situation becomes more complicated as soon as certain folders might have any arbitrary name, only due to their location I know what their permissions should be. Assume that the directory ./foo/bar in the above example might be such a case, i.e. instead of bar the folder could have any name, but still match the -rw permissions. This seems like a very complicated situation, and I'm not even sure if I can solve it with bash scripting alone. I might have to write an actual application.

    Read the article

  • Unpack this directory into your PYTHONPATH?

    - by Gnijuohz
    I want to install qt4reactor so I went to the github page, it says: Unpack this directory into your PYTHONPATH I don't know what that means. I unziped the file and I tried to add the path to PYTHOPNPATH in the .bashrc file like this: export PYTHONPATH=/home/jacos/qtreactor But I can't import it whatsoever. What I want to ask is where exactly is my PYTHONPATH? How can I find that out? What's the right way to do this?

    Read the article

  • compressing dd backup on the fly

    - by Phil
    Maybe this will sound like dumb question but the way i'm trying to do it doesn't work. I'm on livecd, drive is unmounted, etc. When i do backup this way sudo dd if=/dev/sda2 of=/media/disk/sda2-backup-10august09.ext3 bs=64k ...normally it would work but i don't have enough space on external hd i'm copying to (it ALMOST fits into it). So I wanted to compress this way sudo dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-10august09.gz ...but i got permissions denied. I don't understand.

    Read the article

  • Why is the output of ls is like this?

    - by dorelal
    I am using Mac OS X Snow Leopard and when I type ls c * this is what I get in my terminal: clock: PSD demo.html jquery.tzineClock script.js styles.css clock2: clojure-presentations: Clojure-1up.pdf ClojureInTheField-1up.pdf license.html Clojure-4up.pdf README ClojureForRubyists-1up.pdf keynote coffee-script: Cakefile README bin examples index.html package.json test LICENSE Rakefile documentation extras lib src vendor By default I am using Bash.

    Read the article

  • what to do when ctrl-c can't kill a process?

    - by Dustin Boswell
    Ctrl-c doesn't always work to kill the current process (for instance, if that process is busy in certain network operations). In that case, you just see "^C" by your cursor, and can't do much else. What's the easiest way to force that process to die now without losing my terminal? Summary of answers below: Usually, you can Ctrl-z to put the process to sleep, and then do "kill -9 process-pid", where you find the process's pid with 'ps' and other tools. On Bash (and possibly other shells) you can do "kill -9 %1" (or '%N' in general) which is easier. If Ctrl-z doesn't work, you'll have to open another terminal and kill from there.

    Read the article

  • "No space left on device" with FreeBSD

    - by why
    When I login with root, and run "mkdir .ssh", the system says "No space left on device". But if I login with other user, it goes well. [/root]df -h Filesystem Size Used Avail Capacity Mounted on /dev/da0s1a 496M 411M 45M 90% / devfs 1.0K 1.0K 0B 100% /dev /dev/da0s1e 496M 12K 456M 0% /tmp /dev/da0s1f 57G 878M 51G 2% /usr /dev/da0s1d 4.3G 215M 3.8G 5% /var [/root]mkdir .ssh /: create/symlink failed, no inodes free mkdir: .ssh: No space left on device

    Read the article

  • Random password generator: many, in columns, on command line, in Linux

    - by Adam Backstrom
    A while back, I came across a random password generator for the command line that displayed a grid of "memorable" passwords. Output was something like this: adam@host:~$ CantRememberThisCommand lkajsdf aksjdfl kqwrupo qwerpoi qwerklw zxlkelq The idea was that you could run this utility while someone was looking over your shoulder, and still pick a password with some level of secrecy due to the large number of choices. I cannot remember what this utility was called. Oh interwebs, can you help?

    Read the article

  • Bash: Quotes getting stripped when a command is passed as argument to a function

    - by Shoaibi
    I am trying to implement a dry run kind of mechanism for my script and facing the issue of quotes getting stripped off when a command is passed as an argument to a function and resulting in unexpected behavior. dry_run () { echo "$@" #printf '%q ' "$@" if [ "$DRY_RUN" ]; then return 0 fi "$@" } email_admin() { echo " Emailing admin" dry_run su - $target_username -c "cd $GIT_WORK_TREE && git log -1 -p|mail -s '$mail_subject' $admin_email" echo " Emailed" } Output is: su - webuser1 -c cd /home/webuser1/public_html && git log -1 -p|mail -s 'Git deployment on webuser1' [email protected] Expected: su - webuser1 -c "cd /home/webuser1/public_html && git log -1 -p|mail -s 'Git deployment on webuser1' [email protected]" With printf enabled instead of echo: su - webuser1 -c cd\ /home/webuser1/public_html\ \&\&\ git\ log\ -1\ -p\|mail\ -s\ \'Git\ deployment\ on\ webuser1\'\ [email protected] Result: su: invalid option -- 1 That shouldn't be the case if quotes remained where they were inserted. I have also tried using "eval", not much difference. If i remove the dry_run call in email_admin and then run script, it work great.

    Read the article

  • Discrepancy in file size on disk and ls output

    - by smokinguns
    I have a script that checks for gzipped file sizes greater than 1MB and outputs files along with their sizes as a report. This is the code: myReport=`ls -ltrh "$somePath" | egrep '\.gz$' | awk '{print $9,"=>",$5}'` # Count files that exceed 1MB oversizeFiles=`find "$somePath" -maxdepth 1 -size +1M -iname "*.gz" -print0 | xargs -0 ls -lh | wc -l` if [ $oversizeFiles -eq 0 ];then status="PASS" else status="CHECK FAILED. FOUND FILES GREATER THAN 1MB" fi echo -e $status"\n"$myReport The problem is that ls command outputs the files sizes as 1.0MB in the report but the status is "FAIL" as "$oversizeFiles" variable's value is 2. I checked the file sizes on disk and 2 files are 1.1MB. Why this discrepancy? How should I modify the script so that I can generate an accurate report? BTW, I'm on a Mac. Here is what man page for "find" says on my Mac OSX: -size n[ckMGTP] True if the file's size, rounded up, in 512-byte blocks is n. If n is followed by a c,then the primary is true if the file's size is n bytes (characters). Similarly if n is followed by a scale indicator then the file's size is compared to n scaled as: k kilobytes (1024 bytes) M megabytes (1024 kilobytes) G gigabytes (1024 megabytes) T terabytes (1024 gigabytes) P petabytes (1024 terabytes)

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >