Tag Info

Hot answers tagged

9

This is what Bash while loops do: while /path/to/application.app do : done It will run the application, and if it terminates successfully run the body of the loop. : is the shell's no-op command (the loop has to have a body, so that's what we put there); after that it goes back to the top and runs the program again. If it fails, the loop stops running ...


8

If you don't want to be challenged every time for your password then I'd recommend setting it to NOPASSWD in your /etc/sudoers file rather than hardcode your password in your logins. At least this way your primary login's password will remain intact and not be completely exposed in your .bashrc. To make this change run the command sudo visudo, and change ...


4

In Linux, you can try this: top -bn1 > output.txt From man top: -b : Batch-mode operation Starts top in 'Batch' mode, which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you've set with the ...


2

In MacVim, you need to unmap the Edit > Paste menu item in order to override the shortcut, then you can remap Cmd-V (D-v in MacVim parlance) to the appropriate command in each mode. I added this to my ~/.gvimrc and now everything works wonderfully: macmenu Edit.Paste key=<nop> noremap <D-v> "*P cnoremap <D-v> <C-r>* inoremap ...


1

The default behavior of nc is to close the connection if stdin is closed. To change you can use the -q option (like -q -1) on Linux, it might be the same on OS X. See the man page for details. Edit: looks like OS X nc does not support -q switch or anything similar. In this case you need to make sure that stdin gets not closed by doing somehing like this: ( ...


1

Can't you do it from Finder? Also please make sure the external drive is really OSX Extended Journal. It appears it is either NTFS or FAT32.


1

If you have space, please back up the disk as a whole (e.g. dd if=/dev/sdb of=disk.img bs=1M), before running random programs like fsck on things that you don't think are valid partitions :p. I'm not saying you've damaged it, but there's a very good chance of doing so while experimenting. The partition table shown by parted & the kernel looks ...


1

It's kind of one of those things you just have to experience to really understand it. For one, the community is really supportive and educated. You don't get as many of the "Why do you even want to know that?" reactions out of Linux users that you do with users/developers of other operating systems. I would suggest just using it for a few months and getting ...


1

Put the file to ~/.vim/syntax/xt.vim, and ensure that you have :syntax on in your ~/.vimrc. To edit a file with that syntax highlighting, use :edit +setf\ xt the-file or define a filetype detection rule, cp. :help new-filetype.


1

I would comment for your follow-up question but lack enough reputation. To get similar type numbers from a Windows system you will want to take a look at powershell. Just to get a list of processes you and look at get-process. Take a look at this reference. In doing some further searches, found a nice little command here. Which if you take out of the ...


1

I have extended your script, so that you can run it once on startup and it will do it's job between 9PM and 9AM. #!/bin/bash -· LOGFILE="/tmp/autotest_run_count.txt" trap "echo manual abort; exit 1" 1 2 3 15 RUNS=0 while [ 1 ] ; do· HOUR="$(date +'%H')" if [ $HOUR -ge 21 -a $HOUR -lt 9 ] ; then # run program libreoffice || exit 1 ...


1

try do some example, your system supports chained symlinks, for example cd ln -s /bin/ls myls1 ln -s myls1 myls2 ln -s myls2 myls3 start experiment: ./myls1 should work ./myls2 works or not? ./myls3 works or not? When myls3 works, your system supports chained symlinks. I don't belive it doesn't :) Then I think problem is not with symlinks, but with ...



Only top voted, non community-wiki answers of a minimum length are eligible