macports

如何在 Bash 中使用循环

喜夏-厌秋 提交于 2020-04-09 14:50:37
使用循环和查找命令批量自动对多个文件进行一系列的操作。 人们希望学习批处理命令的一个普遍原因是要得到批处理强大的功能。如果你希望批量的对文件执行一些指令,构造一个可以重复运行在那些文件上的命令就是一种方法。在编程术语中,这被称作 执行控制 , for 循环就是其中最常见的一种。 for 循环可以详细描述你希望计算机对你指定的每个数据对象(比如说文件)所进行的操作。 一般的循环 使用循环的一个简单例子是对一组文件进行分析。这个循环可能没什么用,但是这是一个安全的证明自己有能力独立处理文件夹里每一个文件的方法。首先,创建一个文件夹然后拷贝一些文件(例如 JPEG、PNG 等类似的文件)至文件夹中生成一个测试环境。你可以通过文件管理器或者终端来完成创建文件夹和拷贝文件的操作: $ mkdir example $ cp ~/Pictures/vacation/*.{png,jpg} example 切换到你刚创建的那个新文件夹,然后列出文件并确认这个测试环境是你需要的: $ cd example $ ls -1 cat.jpg design_maori.png otago.jpg waterfall.png 在循环中逐一遍历文件的语法是:首先声明一个变量(例如使用 f 代表文件),然后定义一个你希望用变量循环的数据集。在这种情况下,使用 * 通配符来遍历当前文件夹下的所有文件(通配符 *

pip installs packages successfully, but executables not found from command line

冷暖自知 提交于 2020-01-30 14:02:09
问题 I am working on mac OS X Yosemite, version 10.10.3. I installed python2.7 and pip using macport as done in http://johnlaudun.org/20150512-installing-and-setting-pip-with-macports/ I can successfully install packages and import them inside my python environment and python scripts. However any executable associated with a package that can be called from the command line in the terminal are not found. Does anyone know what might be wrong? (More details below) For example while installing a

error: command 'gcc' failed with exit status 1

五迷三道 提交于 2020-01-28 17:18:57
/*--> */ /*--> */ MacOS下想安装MySQL-Python,执行语句: sudo pip install MySQL-Python 遇到了如下错误信息: /*--> */ /*--> */ /Users/kaitlyn/anaconda3/envs/env2.7/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory #include_next <limits.h> /* recurse down to the real one */ ^ compilation terminated. error: command 'gcc' failed with exit status 1 可以看到gcc缺少头文件limit.h,google上看到有一个人遇到了相同的问题,他更新了新版本的gcc,问题得以解决。 解决方案是: 更新gcc 1、下载适用于你的系统的MacPort,地址为 https://www.macports.org/install.php   我的系统是macOS Mojave,所以下载安装 了 macOS Mojave v10.14 2、更新MacPort版本,确保是最新版

Installing GCC to Mac OS X Leopard without installing Xcode

邮差的信 提交于 2020-01-28 05:06:44
问题 I'd like to install gcc to Mac OS X Leopard, and compile some software from source using MacPorts. As http://www.macports.org/install.php has suggested, I've registered as an Apple developer. Now I have to download the Xcode developer tools, but it seems to be enormous. Is such a big download (3.5GB or 1GB) really necessary just for gcc and some header files (mostly for console applications)? Is there a smaller download (possibly on some other site) which would work? Did I find the proper

can't install apt on macports

岁酱吖の 提交于 2020-01-23 11:09:06
问题 THe following error appears :info:build Compiling contrib/hashes.cc to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_apt/work/apt-0.5.27/build/obj/apt-pkg/hashes.opic :info:build Compiling depcache.cc to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_apt/work/apt-0.5.27/build/obj/apt-pkg/depcache.opic :info:build contrib/hashes.cc: In member function 'bool Hashes::AddFD(int, long

Upgrading Ruby installation on Mac OS running Snow Leopard 10.6.5

こ雲淡風輕ζ 提交于 2020-01-14 05:58:07
问题 I have a Mac Os running Snow Leopard 10.6.5 and I am trying to upgrade my Ruby installation. Before I did anything, I run the following commands and I had the following results: $ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] $ which ruby /usr/bin/ruby So, to upgrade my installation, I installed first macports and then Ruby using Ruby Version Manager (RVM). 1. bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head) 2. mkdir -p ~/.rvm/src/ && cd ~/.rvm

Library not loaded error (libidn.11.dylib) when trying to install Homebrew

蓝咒 提交于 2020-01-11 06:32:05
问题 Trying to install Homebrew on Lion. When I do: /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" I get this error: dyld: Library not loaded: /opt/local/lib/libidn.11.dylib Referenced from: /usr/local/bin/curl Reason: image not found I had MacPorts installed previously but uninstalled it and completely removed /opt/local I also removed /opt/local from my PATH Any idea why this error is happening? 回答1: You built and installed curl into /usr/local/bin , but it linked against

Trouble installing libunwind-headers via macports

笑着哭i 提交于 2020-01-11 05:05:50
问题 In an effort to sudo port install gcc47 It appears that i am missing cctools ld64 libunwind-headers where both cctools ld64 depend on libunwind-headers When trying to sudo port install libunwind-headers I get: ---> Building libunwind-headers Error: org.macports.build for port libunwind-headers returned: command execution failed Please see the log file for port libunwind-headers for details: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports

Error Importing scapy into Python interpreter on OSX [MacPorts install]

北城以北 提交于 2020-01-07 04:28:28
问题 I installed scapy via MacPorts as recommended here in the official scapy documentation: http://www.secdev.org/projects/scapy/doc/installation.html#mac-os-x It works just fine when I run scapy from the command-line. However now I can't seem to import scapy into the Python interpreter or in a python script, here's the error. Python 2.7.3 (default, Jan 31 2013, 22:54:33) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or

Build failure during install sqlite3 on Mac OS X 10.6 using MacPorts 1.8

一笑奈何 提交于 2020-01-05 16:26:49
问题 When I do this command : sudo port clean sqlite3 sudo port install sqlite3 I get this error : ---> Computing dependencies for sqlite3 ---> Fetching sqlite3 ---> Verifying checksum(s) for sqlite3 ---> Extracting sqlite3 ---> Configuring sqlite3 ---> Building sqlite3 Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_sqlite3/work/sqlite-3.6.18" && /usr/bin/gnumake all " returned