刚开始使用Linux并练习使用不同的命令,作为一个学习练习,我试图将一个文件附加到我使用以下命令创建的名为"test.tar“的tar存档中:
tar rvf test.tar newfile
它返回了错误:
tar: newfile: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
我也试过:
tar -rvf test.tar newfile
结果是一样的。
学习Python Hard Way (第三版)指出,如果正在使用MS Windows,则应使用Powershell。
正如Zed Shaw所说,我下载cygwin是为了模拟linux环境,Linux是可以接受的。
前10个练习成功执行,没有任何故障。
不幸的是,我遇到了练习11“提问”的问题。
$ more ex11.py
print "How old are you?",
age = raw_input()
print "How tall are you?",
height = raw_input()
print "How much do you we
我在学巴什。在做一个练习时,我犯了一个错误
ifs脚本要求选择,然后显示3条消息中的一条。该错误发生在选择之后。
#!/bin/bash
#nested ifs. script give user option to choose an OS.
osch=0
echo "1.Mac"
echo "2.Linux"
echo -n "Select your OS choice [1 or 2]? "
read osch
if [ $osch -eq 1 ] ; then
echo "You pick up Mac"
else ###