The first line of your .bash_profile is the problem. That line is attempting to run /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin as a command which causes the error you see when you start the shell. Remove that line and the error should go away....
OS X terminal doesn't have the option to split panes vertically. It is only possible to split horizontally. I recommend using iTerm2 on OS X. It has a lot of features missing in default terminal, including possibility to split windows both horizontally and vertically. ...
As per Mathias comment in my question I found the answer here... How can I open Sublime Text 2 files from the command line in linux to a tab, not a new window...
You can do the following: grep -oP "(?<=\">).*(?=</a)" your_file This will print: Lab: K-means Clustering Lab: Hierarchical Clustering Interview with John Chambers Interview with Bradley Efron Interview with Jerome Friedman Interviews with statistics graduate students Since there's no easy way to print only captured groups using grep, I used lookahead...
linux,audio,terminal,speech,sox
I believe that what you are looking for can be achieved with a sox silence command. It allows you to remove the silence from any part of the audio given a threshold, durations above it, etc. For a detailed manual please refer to the sox webpage, the silence section is...
Try diff a b | od -tx1 or some variant...
There are an alias: alias cd='cd /home/l_name' that mades unusable the "cd" functionality, redirecting all "cd" commands to "/home/l_name"...
python,linux,command-line,terminal,arguments
It should be sys.argv[1] not sys.argv[0]: filearg = sys.argv[1] From the docs: The list of command line arguments passed to a Python script. argv[0] is the script name (it is operating system dependent whether this is a full pathname or not). If the command was executed using the -c command...
The instructions from brew after installing nvm are: Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's equivalent configuration file: source $(brew --prefix nvm)/nvm.sh On OS X with default settings, you actually want $HOME/.profile (or ~/.profile). Just add the line above to the end of that file. Running that line...
The defaults command can be used to modify Xcode preferences: term> defaults write com.apple.dt.Xcode.plist Xcode3BuildRulesEditorDisplayMode 1 As Naoto Ida mentioned, changes here will most likely not effect Xcode until it's relaunched....
mongodb,terminal,vi,hybrid-mobile-app,.bash-profile
Check your /etc/hosts for localhost entry and also make sure that mongod is listening to all interfaces, you can check by netstat -an|grep mongo.
osx,bash,shell,terminal,homebrew
Easily done. Just add a semi colon. So.... brew update; brew upgrade; brew cleanup; This is the basics of writing your own BASH scripts. You can write complex scripts that are a single line. echo thanks this is a test; echo ok here is new line, echo run another command...
Could it be that you installed the JRE 8 update 45 but still have version 8 update 31 for JDK?
osx,bash,command-line,terminal
PATH is a special case, because it's going to be overridden by almost any default set of dotfiles. You'll need to review your user's ~/.bashrc, ~/.profile, etc. However, if I run: hello=world open -a Terminal . ...and in that terminal, run echo "$hello" ...the environment variable is successfully propagated through....
python,linux,shell,terminal,command
This will give you the total memory: echo $(cat /proc/meminfo |grep MemTotal) |grep -oE "[0-9]*" This one free memory: echo $(cat /proc/meminfo |grep MemFree) |grep -oE "[0-9]*" This one Active memory: echo $(cat /proc/meminfo |grep Active) |grep -oE "[0-9]*" You can extract all the information you need from /proc/meminfo like...
osx,performance,terminal,stata
From the OS X terminal, cd to the directory containing the CSV files, and run the command ls -lUt | head which should show your files, sorted by the most recent access time, limited to the 10 most recently accessed....
java,eclipse,ubuntu,terminal,virtuoso
I have had a hard time trying to get commands run using Runtime.exec() in the past. Anyways I have shifted to using ProcessBuilder as follows: ProcessBuilder pbuilder = new ProcessBuilder("bash", "-c", <<your command as string>>); File err = new File("err.txt"); try { pbuilder.redirectError(err); Process p = pbuilder.start(); p.waitFor(); } catch...
The cd command is a shell built-in command. There is no shell when you run a command via exec(...). Indeed, if you try to find a cd command in any of your system's bin directories, you won't find one ... because it is impossible to implement as a regular command....
You are using a non supported npm and an old nodejs version, please upgrade node (npm is embedded) ans try again. https://nodejs.org/download/
The problem is with your $PATH variable. You have broken it, so bash does not find any utility out of your current working directory. To fix your issue you can execute vi directly with the absolute path: $ /usr/bin/vi ~/.bash_profile Then edit your $PATH declaration line: export PATH="/Users/james.flan/Documents/Software/MongoDB/bin:$PATH" Then you...
You can use: s/(^\s*^\/\/###==###.*?\/\/###==###\s*)//gms Working Demo Then in the terminal and in Perl. Given: $ echo "$tgt" Text to keep //###==### Text to remove //###==### Text to keep Use the -0777 command flag to slurp the whole file and then: $ echo "$tgt" | perl -0777 -ple 's/(^\s*^\/\/###==###.*?\/\/###==###\s*)//gms' Text to...
c++,linux,terminal,progress-bar
The only portable way of moving the cursor around that I know of is using \r to move to the beginning of the line. You mention that you would like to output stuff above the progress. Fortunately, you are in luck since you're on Linux and you can use the...
You need to do two things: Create an array of all your input variables Loop through the array and initiate all your calls The following illustrates the concept: #!/bin/ksh #Create array of inputs - space separator inputs=(Input1 Input2 Input3 Input4) # Loop through all the array items {0 ... n-1}...
I wouldn't bother faffing around with building it yourself. I would install homebrew from here. Then you can simply do brew install gphoto2 and you will also have a decent package manager if you want to install other cool stuff later on - e.g. ImageMagick, gawk, GNU sed, swatch, youtube-downloader,...
haskell,terminal,filehandle,pty
Don't you want to read from the master handle? ... hMaster <- fdToHandle master hGetContents hMaster >>= print . take 10 ... ...
ruby-on-rails,ruby,terminal,syntax-error,rake
You have a typo on line 16th: Location.create(area: 'College Ave', should be Location.create(area: 'College Ave') ...
osx,terminal,background-image,osascript
Unless something has changed, OS X does not expose the background image property to osascript. However, you can do the following: osascript -e 'tell application "Terminal" to set background color of first window to {0,17655,0,-16373}' So, you could change the color via script. If you really want an image, though,...
java,events,ubuntu,terminal,mouse
Check that your buffer size is correct. In recent Linux kernels size of input_event structure is dependent on many things, but mainly on cpu architecture. Here's its declaration: struct input_event { struct timeval time; __u16 type; __u16 code; __s32 value; }; On 32-bit systems it's very likely that your buffer...
Primarily, terminals are just plain slow. For every update, they have to: Parse and interpret any control codes. Parse, interpret and render any escape codes. Interpret and account for any multibyte and composed characters. Update appropriate screen and scroll buffers. Render this with appropriate fonts. and possibly do all of...
shell,command-line,awk,terminal
If order is not important, join and awk can do the job easily. $ join <(sort input.txt) <(sort mapping.txt) | awk -v OFS="|" '{for (i=3;i<NF;i++) print $2, $i OFS}' 103823054|001| 103823044|011| 103823044|012| 103823044|013| 103823064|011| 103823064|012| 103823064|013| ...
You have to install git-autocomplete which can be get with homebrew: Install Git and bash-completion: brew install git bash-completion (Note: If this install fails with a 404 error, and you already have git installed, just remove the git part of this brew install) Add bash-completion to your .bash_profile: if [...
osx,unix,terminal,user,osx-yosemite
Looks as though i found the answer: sudo scutil --set HostName name-you-want ...
It is not that simple. This question occasionally arises when someone wants left/right scrolling for a mouse trackball. On the left column of the tables is an X event. Those are limited to combinations of predefined symbols. Button4 and Button5 are mentioned because those are conventionally used to pass the...
I just had the same issues with an SCP from my personal Mac to a Mac desktop we use as a local server. Running sudo sshd -t showed me the following hint: /var/empty must be owned by root and not group or world-writable All I did was change the owner...
I guess you could use something like this: find . -maxdepth 2 -type d -name "MWACluster15" -execdir ls {}/logs/ \; -execdir executes a command from the directory in which the directory you're interested in is found. The {} is a placeholder which is substituted with the directory name "MWACluster15"....
I think I found what I'm looking for. According to WikiPedia's ANSI escape code, the standard adopted was ECMA-48, the document is available at www.ecma-international.org Ecma-048.pdf
The errors that you are getting are because the cout is not in the global namespace rather it is in std namespace. Well instead of writing using namespace std; after #include <iostream> try using: using std::cout; since using first option is a bad practice. You can refer to Why is...
jquery,scroll,terminal,position,jquery-terminal
Add a height option: JS $('#terminal').terminal(function (command, term) { if (command == 'test') { term.echo("you just typed 'test'"); } else { term.echo('unknown command'); } }, { prompt: '>', name: 'test', height: 200 }); Demo: http://jsfiddle.net/11o3spLd/...
Here is a basic example: Code: #!/usr/bin/env python from string import printable from curses import erasechar, wrapper PRINTABLE = map(ord, printable) def input(stdscr): ERASE = input.ERASE = getattr(input, "ERASE", ord(erasechar())) Y, X = stdscr.getyx() s = [] while True: c = stdscr.getch() if c in (13, 10): break elif c...
sshd of course is configurable, and can be made to listen on different ports. These discuss it at length: Change the default SSH port Getting SSH to listen to different ports on different interfaces The underlying issue is what would one do with this. That has been asked before, with...
Doing source $(brew --prefix nvm)/nvm.sh exports nvm() function into your shell environment. It's not a reference to an executable, but the function whose contents you see when you do which nvm.
osx,bash,replace,command-line,terminal
awk seems like the tool for the job: awk 'NR == FNR { a[$1] = $2; next } FNR == 1 { FS = "|"; OFS = FS; $0 = $0 } { $2 = a[$2] } 1' mapfile datafile The code works as follows: NR == FNR { #...
Here is the situation: which mongod would give you the path to the mongod binary. If there is no output from which, there which could not find mongod. This may be the case that there is not path in the $PATH variable, that contains the mongod binary. You can make...
c++,terminal,command-prompt,cout,clion
Fixed it. CLion can't properly handle missing DLL files and although I had a lib inside my MinGW lib folder, windows wasn't finding it and thus the application was erroring. I moved the DLL to my windows folder and now it works fine....
hash,terminal,applescript,osx-mavericks
From what I understand, at least conceptually, what you're asking for requires 2 steps: Obtain a random salt value. Concatenate the salt value with the input text (password) and compute the hash for the combined value. For later verification, you'll have to store the salt along with the resulting hash....
ruby-on-rails,ruby,error-handling,terminal
You could try better_errors gem. It provides also a better explanation of the errors via browser. This is the link to the github repo EDIT If you are looking also to a customizable console (also the exception trace) try to see pry...
Use Perl's options to assemble a oneliner. perl -lpe '$_ = reverse $_ unless $.%2' file -l (lowercase L) chops off the terminating newline and adds it back on when printing; -p causes Perl to loop over input lines and print each after running the script on it; $_ is...
You need to be root to write into /Library, so you need to use sudo, as the instructions tell you: $ sudo gem install cocoapods ...
I would suggest you use switch case for the conditions and a while loop for the enter 1,2,3 thing.. Something like bool running=true; while(running) { running = false; switch(i) { case 1: stuff; break; case 2: stuff; break; case 3: stuff; break; default: cout<<"enter 1,2,3"; running = true; } }...
bash doesn't let you redirect stdout twice. Instead, redirect stdout and stderr separately: ./program input.txt > output.txt 2> log ...
Perhaps this is for Linux (although OSX adds an interesting twist by reversing the roles of bash and echo). Linux's /bin/echo has a -e option which expands escapes of the sort you show, while some shells (such as dash, used in Debian) follow POSIX more closely, and do not do...
rlwrap is a wrapper program to allow CLI commands that prompt for input use the readline library without having to link against it.
asp.net,terminal,yeoman,yeoman-generator,yosemite
You need to change the permissions of your usr/local folders by running the following code: sudo chown -R $USER /usr/local sudo chown -R yourUsername ~/.npm npm install -g yo grunt-cli bower Once you have completed this step, reset the generator-aspnet by running the following lines of code: npm install -g...
linux,ubuntu,terminal,output,execute
The easiest way to capture all of the output to the terminal is using script, e.g., script -c "somecommand arguments" writes the output of "somecommand arguments" to the file typescript. If the program that you are running prompts for input, script will not interfere with that....
I think you need ipcs. You can find more informations there : http://www.makelinux.net/alp/035 http://linuxcommand.org/man_pages/ipcs8.html ...
system doesn't return the output the command you run but simply returns the exit status. You probably want to use popen() to read the output of the command you run. See an example in the linked man page. You also need to use strcmp for comparing strings, not ==....
Imagine your mysterious program is called fred and you run it by typing ./fred in the Terminal. Now, you can make the output get sent into a file called file.txt by running it like this: ./fred > file.txt Now, you can copy the first 10 lines of the file by...
When you run heroku login command, it will write your Heroku API key to the .netrc file. If you first run sudo heroku login, then the .netrc file will be owned by the root account and not your user account. Unless you change permissions on the file using chmod a+x...
exec provides a second parameter which can be used to get the output of the process exec("sudo /root/modbus/writeForceReg 2 0", $output); If the application is using the stderr instead of stdout you need to use proc_open: http://php.net/manual/en/function.proc-open.php...
linux,python-2.7,terminal,virtualenv
You have to activate the virtualenv in every shell, or, as 0range suggested, activate it in your .bashrc or any script running before your shell displays the prompt. To add it to your .bashrc : Edit /home/youruser/.bashrc and add the line : source /path/to/bin/activate Open a new shell or source...
bash,shell,variables,if-statement,terminal
Using your code something like this is what you could use SpecficStatus="Pass" #SetVariable timestamp() { date +"%T %D"; } SpecficDate=$(timestamp) echo $SpecficStatus echo $SpecficDate ...
bash,unix,terminal,bioinformatics,qiime
If you don't mind using sedand assuming other line starts with > then the following will remove the first 15 contiguous uppercase characters "A-Z" of the other lines: sed 's/^[A-Z]\{15\}//' file > new_file Or, in place edit (GNU sed) use -i: sed -i 's/^[A-Z]\{15\}//' file Or, in place edit (BSD...
This works on a Mac (includes the %): ps -A -o %cpu | awk '{s+=$1} END {print s "%"}' To break this down a bit: ps is the process status tool. Most *nix like operating systems support it. There are a few flags we want to pass to it: -A...
bash,shell,date,if-statement,terminal
You have to use two conditions: if [ "$TodaysDate" = "$prevDate" ] && [ "$TodaysDate" = "$currDate" ] ; then or the -a operator (not recommended) if [ "$TodaysDate" = "$prevDate" -a "$TodaysDate" = "$currDate" ] ; then or, if you're in bash, switch to [[ ... ]] conditions: if...
In line one: What is '' file? According to help read, that '' is an argument to the -d parameter: -d delim continue until the first character of DELIM is read, rather than newline In line six: What does the empty space do in < < (find). There are...
This solution is not perfect but it should do what you want (assuming I understood your question correctly): Create a file doCopy.sh with the following content: #!/bin/bash origName=$1 newName=$(echo $origName | sed -e 's|/|.|g') echo cp $origName $newName Then make it executable and call it for each of your files:...
osx,terminal,executable,app-bundle
I believe what you're seeing is correct. In order for a separate window to not pop-up, you'd need to encapsulate it into a bundle. Launching by double-clicking a bundle, or using the 'open' command from Terminal uses Apple's Launch Services, which maintains a list of known (registered) applications. When an...
cmd = "ls > somefile.txt" system( cmd ) or even just simply system( "ls" ) Thus, you can use system....
c++,terminal,console,formatting,output
You can either print the "="s without a line break or you can use ncurses which I think also wget uses. But in my opinion ncurses is much work to do. For small Projects I recommend the simpler way....
Make sure you have Visual Studio Code 0.3.0 installed. We recently changed the bundle identifier!
According to the manual page for nanorc, you cannot do this. It does not accept bindings for special keys modified by meta. This is what it says regarding M- (the meta-modifier): M- followed by a printable character or the word "Space". Example: M-C A similar question was asked in Bind...
python,terminal,curses,python-curses
This code allows you to create a little menu in a box from a list of strings. You can also use this code getting the list of strings from a sqlite query or from a csv file. To edit the max number of rows of the menu you just have...
linux,shell,scripting,terminal
Try doing this in single one awk statement: who | awk '{print "The user " $1 " is on " $2}' By doing that many piping, you are sending first one's input as another ones output. Hence you are losing previous data and at last only the output of who...
java,ubuntu,javafx,terminal,javafx-8
You are missing the package while firing java command. (Implied from the comments, since it is not included in the question) After compiling, navigate back to src folder and append the package to your class name : java com.jdojo.intro.HelloFXApp ...
First: Don't do any of this. Structure your program some other way. If you described to us why you think you need this behavior, we could potentially have told you how to achieve it otherwise. Getting down to the question: If you wrap your block in a loop, you can...
There is no portable way to determine if a given device supports colors. There are several programming interfaces (some portable, some not) which attempt to determine this information, but rely upon being configured properly. For instance, curses (including ncurses) relies upon your setting TERM correctly to tell the library what...
ruby-on-rails,ruby,wordpress,terminal,rbenv
So you're working with rbenv. According to its README, you should run rbenv rehash after installing any gems that have an executable command. Also, run it anytime you install a new Ruby version.
I found the solution here : https://github.com/Carthage/Carthage/issues/330 Steps: sudo rm -rf /Library/Frameworks/CarthageKit.framework rm -f /usr/local/bin/carthage brew uninstall carthage brew install carthage ...
Perhaps your jarfile is corrupted in some way, possibly due to how it was downloaded or installed. this issue is caused by manifest file because you haven't added space after every colon in here, it should be: Manifest-Version: 1.0 Created-By: 1.7.0_79 (Oracle Corporation) Class-Path: mysql-connector-java-5.1.28.jar Main-Class: JavaApplication1 after Main-Class there...
Put this in your ~/.inputrc: set show-all-if-ambiguous on You'll need to restart your shell (for example by opening a new terminal window or typing exec /bin/bash)....
tl; dr Use the following, locale-independent commands: files and folders: mdfind 'kMDItemUserTags == Red' files only: mdfind 'kMDItemUserTags == Red && ! kMDItemContentType == public.folder' folders only: mdfind 'kMDItemUserTags == Red && kMDItemContentType == public.folder' Simpler, but locale-specific equivalents - these only work in English-language locales and must be localized...
You can use pushd and popd. pushd adds a directory to stack, popd removes it. See man bash for details.
php,bash,drupal,terminal,macports
Do not modify files in /usr/bin. That's Apple's turf, and there are always other possibilities to avoid changing things there, especially since Apple's next update will happily revert these changes again and scripts might rely on /usr/bin/php being exactly the version Apple shipped with the OS. Put the original binary...
There is more than one problem: xtermc does not match any terminal that you are likely to encounter (noted in xterm FAQ What $TERM should I use? dtterm does not match xtermc either (use infocmp xtermc dtterm to see). Sun stopped providing up-to-date terminal entries about 20 years ago. Perhaps...
You were close with your second attempt. To substitute the output of a command into a command line, you use $( command ). open -a TextEdit $(find . -type f | gshuf -n2) However, this won't work properly if any of the filenames have spaces in their names, because each...
Issue has been caused due to localedef I am able to confirm post getting a reply from Apple Support team. As per the support team instruction I created a New User Account and checked terminal. With new account terminal worked well. Best solution is New User Account if we want...
The :compiler command selects a compiler plugin; there's one named gcc, but none named g++. That's the E666 you get. You can obtain a list of all installed compiler plugins by typing :compiler followed by <C-D> (lists all) or <Tab> (completion). Note that compilation of C/C++ source code is usually...
The usual reason for this is due to not quoting escape sequences used to color or highlight your prompt in the bash shell. If you do not do that, bash counts the escape characters as "printing". The same would apply for zsh (different quoting), but bash happens to be the...
node.js,terminal,gulp,taskmanager
Other answers are bypassing these issues by the use of sudo or su root. I personally don't recommend this. The reason it works is because on OSX the global npm module directory has stricter permissions. Running your commands with root privileges just to get around permissions issues is likely only...
You might be looking for the subprocess module. You can do (for example): subprocess.call("<bash command here>", shell = True) For more details check the documentation....
This is called ASCII art. Have a look at this thread, might give you an idea how it works and how you come up with images/graphics like that. After you know what you want to print, you can simply output it like any other string....
test sample: └> cat hello.py class Hello: def hello(self): print "hello" └> python -c 'from hello import Hello; h= Hello(); h.hello()' hello └> python -c 'import hello; h= hello.Hello(); h.hello()' hello you can choose either import mypackage.mymodule or from mypackage.mymodule import myclass python -c 'from lighting import OfficeLights; lights =...