terminal

Harvard CS50 Library , Need Help Installing on Mac OS X

给你一囗甜甜゛ 提交于 2020-01-06 04:55:05
问题 I'm taking this course from cs50.tv, which is Harvard extension school and in the course they are using a library they made called cs50 , on this link its available for download https://manual.cs50.net/CS50_Library#Mac_OS I downloaded the zip file and unzipped it, and then I open the terminal and cd my way to the library directory, but every time I follow the steps in the manual. Right after I do this command gcc -c -ggdb -std=c99 cs50.c -o cs50.o I get this error in the terminal cs50.c:15:16

How to move cursor word by word in PhpStorm integrated terminal?

蹲街弑〆低调 提交于 2020-01-06 04:50:48
问题 I can't use my zsh shortcuts to move the caret by word in PhpStorm's integrated terminal window using i.e. ⌥ → like I use in Terminal App on my Mac. I have tried to use zsh as shell path in PhpStorm but my default zsh color scheme is not showing well inside of PhpStorm. Seems that also Mac Terminal->Settings shortcuts are not being enabled inside PhpStorm terminal. 回答1: I have found out that it work only if I bind the shortcuts directly in my ~/.bash_profile , by adding this at the bottom:

pip install networkit error

不打扰是莪最后的温柔 提交于 2020-01-06 02:31:09
问题 I'm using the pip install networkit provide by the networkit homepage, but I don't know what's going wrong here, the terminal keep showing this: Downloading/unpacking networkit Downloading networkit-3.4.1.tar.gz (582kB): 582kB downloaded Running setup.py (path:/private/var/folders/sy/lzckft690rn8xfm2f1svp8p00000gn/T/pip_build_runze/networkit/setup.py) egg_info for package networkit Traceback (most recent call last): File "<string>", line 17, in <module> File "/private/var/folders/sy

Using SED -n with variables in a script

旧时模样 提交于 2020-01-06 02:07:24
问题 I am trying to use sed in a script but it keeps failing. The commands on their own seem to work so I am not sure what I am doing wrong: This is in Terminal in OS X (bash) NOTE: file1.txt contains multiple lines of text N=1 sed -n $Np < file1.txt > file2.txt CONTENT=$(cat file2.txt) echo $CONTENT If I change $N to 1, it works perfectly sed -n 1p <file1.txt >file2.txt CONTENT=$(cat file2.txt) echo $CONTENT gives me content of file2.txt So basically, I am trying to copy the text from line 1 of a

Replace all occurrences without changing file endings

╄→尐↘猪︶ㄣ 提交于 2020-01-06 01:33:29
问题 To replace all occurrences of a word with another in all files with a particular extension in the current directory I use this command: find . -type f -name '*.zz' -exec sed -i '' "s/replace_this/with_this/" {} + The problem is that it adds \n to the end of files that do not end in \n . Now don't get me wrong, I love \n terminated files as much as the next person. But I don't want all those changes in my git diff. What's a command to run that does the same thing but without touching file

how to make terminal resize to 20 lines in C?

。_饼干妹妹 提交于 2020-01-05 13:56:08
问题 I'm writing a terminal game build on ncurses . I should ensure the window in suitable size. How to adjust terminal window display 20 lines when running the process? I think it should be use some C API. Thanks 回答1: You can use int resizeterm(int lines, int columns); to properly resize the terminal in ncurses. Edit The OP wants to change the font of Terminal so It's not really possible to adjust the terminal font using an ncurses. That's beyond the scope of ncurses. however if you're on mac :-)

C-S-DEL (Kill an entire line at once) doesn't work in my emacs

*爱你&永不变心* 提交于 2020-01-05 12:59:29
问题 This says that C-S-DEL is bound to kill-whole-line command that kills an entire line at once. I tried it on my macbook with emacs 24.5.1, however, it doesn't work at all. I then use C-h k C-S-DEL to check what happened when I press this hotkey. It says that, only DEL key is recognised other than Ctrl + Shift + DEL . I install this emacs (version 24.5.1) via Homebrew and run it in iTerm2. It does't have a GUI version (I prefer to use in terminal), and is launched simply via emacs command. How

C-S-DEL (Kill an entire line at once) doesn't work in my emacs

穿精又带淫゛_ 提交于 2020-01-05 12:59:19
问题 This says that C-S-DEL is bound to kill-whole-line command that kills an entire line at once. I tried it on my macbook with emacs 24.5.1, however, it doesn't work at all. I then use C-h k C-S-DEL to check what happened when I press this hotkey. It says that, only DEL key is recognised other than Ctrl + Shift + DEL . I install this emacs (version 24.5.1) via Homebrew and run it in iTerm2. It does't have a GUI version (I prefer to use in terminal), and is launched simply via emacs command. How

Bash program in cron that runs everytime the program is terminated

梦想与她 提交于 2020-01-05 10:37:08
问题 I want to set a cron job in ubuntu with this job I have a python webscraping program which needs to be scrapped continuously after the program is terminated. In other words the flow is like this If program is terminated, set the cron job again (until infinity in cron's method) something like * * * * * /python.py (but only when the python.py is terminated/finished) Can someone guide me to write a bash program that does this job? The program is python.py thanks 回答1: when the program runs, write

mac os x terminal problem faced

梦想的初衷 提交于 2020-01-05 08:52:20
问题 oh my god...i faced a big problem...i was created a .bash_profile in ~ folder and then set paths there...bust the big problem is after restarting my bash i see that none of my commands work like LS and RM and etc... now i dont know how to fix it...some one help me...i need my terminal as soon as possible... 回答1: Make sure you are appending to the existing $PATH. PATH=$PATH:/Users/mthalman/bin 回答2: To prevent this happening in the future: When I edit my environment files (including bashrc,