我正在编写一个bash脚本,我需要将包含空格的字符串传递给我的bash脚本中的函数.
例如:
#!/bin/bash
myFunction
{
echo $1
echo $2
echo $3
}
myFunction "firstString" "second string with spaces" "thirdString"
Run Code Online (Sandbox Code Playgroud)
运行时,我期望的输出是:
firstString
second string with spaces
thirdString
Run Code Online (Sandbox Code Playgroud)
但是,实际输出的是:
firstString
second
string
Run Code Online (Sandbox Code Playgroud)
有没有办法将带空格的字符串作为单个参数传递给bash中的函数?
我是第一次成立Travis-CI.我以我认为的标准方式安装scipy:
language: python
python:
- "2.7"
# command to install dependencies
before_install:
- sudo apt-get -qq update
- sudo apt-get -qq install python-numpy python-scipy python-opencv
- sudo apt-get -qq install libhdf5-serial-dev hdf5-tools
install:
- "pip install numexpr"
- "pip install cython"
- "pip install -r requirements.txt --use-mirrors"
# command to run tests
script: nosetests
Run Code Online (Sandbox Code Playgroud)
一切都在建立.但是当测试开始时,我得到了
ImportError: No module named scipy.ndimage
Run Code Online (Sandbox Code Playgroud)
更新:这是一个更直接的问题演示.
$ sudo apt-get install python-numpy python-scipy python-opencv
$ python -c 'import scipy'
Traceback (most recent call last):
File …Run Code Online (Sandbox Code Playgroud)