在 Maemo 中运行 bash shell

发布于 2024-08-16 07:48:51 字数 270 浏览 5 评论 0原文

我尝试在我的互联网平板电脑(在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

昔梦 2024-08-23 07:48:51

当您运行脚本时实际上会发生什么?如果您包含与预期不同以及方式不同的错误消息或行为的详细信息,这会很有帮助。

如果 $WORKING 包含目录名称(无论是否隐藏),那么 cp 应该将这四个文件复制到其中。然后 ls -l /home/user/.gpe 应该显示它们以及其中的其他内容,无论它是否“隐藏”。

顺便说一句,文件或目录名称中的初始点并没有真正“隐藏”该条目,只是 lsecho * 以及类似的命令不会向他们展示,而这些则:

ls -la
ls -d .*
ls -d {.*,*}
echo .*
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. Then ls -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 and echo * and similar commands don't show them, while these do:

ls -la
ls -d .*
ls -d {.*,*}
echo .*
echo {.*,*}
半葬歌 2024-08-23 07:48:51

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.

几度春秋 2024-08-23 07:48:51

如果这就是你的整个脚本,那么它就少了两个。可能的三、事物:

  • shebang 行,例如 #! /bin/sh 开头
  • 使用 $SVNPATH。您可能需要在 cp 命令之前cd $SVNPATH。您的脚本不应假定当前工作目录是正确的。
  • 可能对脚本执行权限:chmod a+x script

If that's the entirety of your script, it's missing two. possible three, things:

  • A shebang line, such as #!/bin/sh at the start
  • Use of $SVNPATH. You probably want to cd $SVNPATH before the cp command. Your script should not assume the current working directory is correct.
  • Possibly execute permission on the script: chmod a+x script
來不及說愛妳 2024-08-23 07:48:51

您已经有 /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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文