在 Maemo 中运行 bash shell
我尝试在我的互联网平板电脑(在 Maemo Linux 上运行的诺基亚 N810)上运行以下 bash 脚本。然而,它似乎没有在运行,而且我不知道这个脚本出了什么问题(如果我更改目录,它会在我的 Ubuntu 系统上运行)。很高兴收到有关此问题的一些反馈或类似的经历。谢谢。
WORKING="/home/user/.gpe"
SVNPATH="/media/mmc1/gpe/"
cp calendar categories contacts todo $WORKING
I have attempted to run the following bash script on my internet tablet (Nokia N810 running on Maemo Linux). However, it doesn't seem that it is running, and I have no clue of what's wrong with this script (it runs on my Ubuntu system if I change the directories). It would be great to receive some feedback on this or similar experiences of this issue. Thanks.
WORKING="/home/user/.gpe"
SVNPATH="/media/mmc1/gpe/"
cp calendar categories contacts todo $WORKING
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当您运行脚本时实际上会发生什么?如果您包含与预期不同以及方式不同的错误消息或行为的详细信息,这会很有帮助。
如果 $WORKING 包含目录名称(无论是否隐藏),那么 cp 应该将这四个文件复制到其中。然后 ls -l /home/user/.gpe 应该显示它们以及其中的其他内容,无论它是否“隐藏”。
顺便说一句,文件或目录名称中的初始点并没有真正“隐藏”该条目,只是
ls
和echo *
以及类似的命令不会向他们展示,而这些则:What actually happens when you run your script? It's helpful if you include details of error messages or behavior that differs from what's expected and in what way.
If $WORKING contains the name of a directory, hidden or not, then the
cp
should copy those four files into it. Thenls -l /home/user/.gpe
should show them plus whatever else is in there, regardless of whether it's "hidden".By the way, the initial dot in a file or directory name doesn't really "hide" the entry, it's just that
ls
andecho *
and similar commands don't show them, while these do:bash
cp
命令可以将多个源复制到单个目标(如果它是目录)。目录
/home/user/.gpe
是否存在?请记住,名称中的前导点可以使其隐藏,除非您使用
ls -a
我在cygwin中尝试了您的命令:
但我使用了
.gpe< /code> 而不是
/home/user/.gpe
我做了一个
触摸日历类别联系人待办事项
来创建文件。效果很好。
The bash
cp
command can copy multiple sources to a single destination, if it's a directory.Does the directory
/home/user/.gpe
exist?Bear in mind that the leading dot in the name can make it hidden unless you use
ls -a
I tried your commands in cygwin:
But I used
.gpe
instead of/home/user/.gpe
I did a
touch calendar categories contacts todo
to create the files.It worked fine.
如果这就是你的整个脚本,那么它就少了两个。可能的三、事物:
#! /bin/sh
开头cp
命令之前cd $SVNPATH
。您的脚本不应假定当前工作目录是正确的。chmod a+x script
If that's the entirety of your script, it's missing two. possible three, things:
#!/bin/sh
at the startcd $SVNPATH
before thecp
command. Your script should not assume the current working directory is correct.chmod a+x script
您已经有 /home/user/.gpe 目录了吗?另外,尝试添加 -R 参数,以便递归复制目录。
Do you already have the /home/user/.gpe directory present? And also, try adding a -R parameter so that the directories are copied recursively.