AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-339536

Praveen's questions

Martin Hope
Praveen
Asked: 2020-11-19 11:05:37 +0800 CST

具有交互式输入的 Bash printf 序列

  • 1
这个问题在这里已经有了答案:
bash 脚本 – for i in {x..y} [重复] (2 个答案)
1 年前关闭。

在 bash 中,如何以printf交互方式获取输入以打印序列。我尝试了以下方法:

read x; read y; printf '%s\n' {"$x".."$y"..5}
0
40
{0..40..5}

我试图得到这样的输出:

printf '%s\n' {0..40..5}
0
5
10
15
20
25
30
35
40
command-line bash
  • 1 个回答
  • 272 Views
Martin Hope
Praveen
Asked: 2020-11-04 05:27:16 +0800 CST

从文本文件到另一个模式之间的命令行内容复制

  • 0

我将 html 文件内容复制到以下形式的文本文件中:

... course 10> user_1 </a><br /><a class="reviewlink" href="https://www.foo.com/moodle/mod/quiz/review.php?attempt=1491">Review attempt<...
... course 10> user_2 </a><br /><a class="reviewlink" href="https://www.foo.com/moodle/mod/quiz/review.php?attempt=1498">Review attempt<...

从这里使用一些shell命令我可以得到内容:

user_1 "https://www.foo.com/moodle/mod/quiz/review.php?attempt=1491"
user_2 "https://www.foo.com/moodle/mod/quiz/review.php?attempt=1498"

到另一个文本文件。

这里...表示一些大的独特文本。

编辑

为用户提供更详细的表格:

 <label for="attemptid_1502" class="accesshide">Select attempt</label></td><td class="cell c1 picture" id="mod-quiz-report-responses-report_r1_c1"><a href="https://www.foo.com/moodle/user/view.php?id=380&amp;course=10" class="d-inline-block aabtn"><img src="https://www.foo.com/moodle/pluginfile.php/419/user/icon/moove/f2?rev=6942" class="userpicture" width="35" height="35" alt="Picture of user 1" title="Picture of user 1" /></a></td><td class="cell c2 bold" id="mod-quiz-report-responses-report_r1_c2"><a href="https://www.foo.com/moodle/user/view.php?id=380&amp;course=10">user 1</a><br /><a class="reviewlink" href="https://www.foo.com/moodle/mod/quiz/review.php?attempt=1502">Review attempt</a></td><td class="cell c3" id="mod-quiz-report-responses-report_r1_c3">meethu</td><td class="cell c4" id="mod-quiz-report-responses-report_r1_c4">text</td><td class="cell c5" id="mod-quiz-report-responses-report_r1_c5">Finished</td><td class="cell c6 bold" id="mod-quiz-report-responses-report_r1_c6"><a href="review.php?q=62&amp;attempt=1502">0.00</a></td><td class="cell c7" id="mod-quiz-report-responses-report_r1_c7"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=1" id="action_link5fa01d6f2fd9a29" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c8" id="mod-quiz-report-responses-report_r1_c8"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=2" id="action_link5fa01d6f2fd9a30" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c9" id="mod-quiz-report-responses-report_r1_c9"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=3" id="action_link5fa01d6f2fd9a31" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c10" id="mod-quiz-report-responses-report_r1_c10"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=4" id="action_link5fa01d6f2fd9a32" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c11" id="mod-quiz-report-responses-report_r1_c11"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=5" id="action_link5fa01d6f2fd9a33" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c12" id="mod-quiz-report-responses-report_r1_c12"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=6" id="action_link5fa01d6f2fd9a34" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c13" id="mod-quiz-report-responses-report_r1_c13"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=7" id="action_link5fa01d6f2fd9a35" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c14" id="mod-quiz-report-responses-report_r1_c14"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=8" id="action_link5fa01d6f2fd9a36" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c15" id="mod-quiz-report-responses-report_r1_c15"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=9" id="action_link5fa01d6f2fd9a37" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c16" id="mod-quiz-report-responses-report_r1_c16"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=10" id="action_link5fa01d6f2fd9a38" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c17" id="mod-quiz-report-responses-report_r1_c17"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=11" id="action_link5fa01d6f2fd9a39" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c18" id="mod-quiz-report-responses-report_r1_c18"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=12" id="action_link5fa01d6f2fd9a40" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td><td class="cell c19" id="mod-quiz-report-responses-report_r1_c19"><a href="https://www.foo.com/moodle/mod/quiz/reviewquestion.php?attempt=1502&slot=13" id="action_link5fa01d6f2fd9a41" class=""  title="Review response" ><span class="que"><i class="icon fa fa-remove text-danger fa-fw icon"  title="Incorrect" aria-label="Incorrect"></i><span class="notanswered">-</span></span></a></td></tr><tr class="" id="mod-quiz-report-responses-report_r2"><td class="cell c0" id="mod-quiz-report-responses-report_r2_c0"><input id="attemptid_1505" name="attemptid[]" type="checkbox"  value="1505"
   data-action="toggle"
   data-toggle="slave"
   data-togglegroup="quiz-attempts"
   
/>
scripts command-line bash sed copy
  • 2 个回答
  • 50 Views
Martin Hope
Praveen
Asked: 2020-04-23 08:56:40 +0800 CST

Apache 提供“It works”页面而不是网站的主页

  • 0

我的网站www.domainname.com加载 apache2 'It works' 页面,而不是预期的 moode 主页,该主页位于/var/www/html/moodle. 在moodle目录中有一个索引文件index.php,但默认不使用。如果我去www.domainname.com/moodle网站主页来。配置文件/etc/apache2/sites-available/domainname.conf已启用。如何解决这个问题?

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    ServerName www.domainname.com
    ServerAlias domainname.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/moodle
    DirectoryIndex "index.php"
    # <Directory /var/www/html/>
    #       AllowOverride All
    # </Directory>  

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
 RewriteEngine on
 RewriteCond %{SERVER_NAME} =www.domainname.com
 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
server apache2 webserver 18.04
  • 3 个回答
  • 7525 Views
Martin Hope
Praveen
Asked: 2015-12-22 07:20:35 +0800 CST

分布命名法是如何完成的?[复制]

  • 1
这个问题在这里已经有了答案:
如何选择发布代号? (2 个回答)
版本如何命名?[重复] (2个答案)
6年前关闭。

Ubuntu 发行版命名法是如何完成的?例如,为什么 14.04 Ubuntu 被命名为“Trusty Thar”?同样,所有已发布版本的这种命名法的动机是什么?还有谁是决定名字的权力?

release-management
  • 1 个回答
  • 44 Views
Martin Hope
Praveen
Asked: 2015-12-16 04:00:21 +0800 CST

matlab 返回错误

  • 1

我在 linux 中运行 matlab。在 matlab 中运行脚本时出现以下错误。这里的 RayMet_012007.ray_paths 是位于自定义目录中的输入。

/bin/bash: line 0: type: RayMet_012007.ray_paths: not found
/bin/bash: line 0: type: RayMet_00.ray_paths: not found
Undefined function or variable 'AD'.

我无法弄清楚问题所在。该脚本正在运行。matlab 也安装在自定义目录中。

http://pastebin.com/CRSPpRzm(完整脚本)

scripts
  • 1 个回答
  • 42 Views
Martin Hope
Praveen
Asked: 2014-12-07 02:52:45 +0800 CST

如何将终端中的输入和输出获取到文本文件?[复制]

  • 4
这个问题在这里已经有了答案:
如何在控制台上显示命令行的输出并将输出保存到文本文件中? (5 个答案)
如何在同时工作的同时从特定终端捕获文本并将其重定向到日志文件?[重复] (1 个回答)
7 年前关闭。

我想创建一个文本文件,它将添加我将在终端上运行的每个命令作为文本文件中的新行条目。即,我需要记录我在终端中所做的事情。此外,如果我可以将终端中的输出记录以及终端中的输入记录为文本文件,那就更好了。

每次我忘记一个命令时,我都必须在 Internet 上再次搜索该命令。
我可以像上面那样制作一个文件吗?

command-line
  • 2 个回答
  • 8534 Views
Martin Hope
Praveen
Asked: 2014-12-07 01:54:00 +0800 CST

从存档缓存安装文件

  • 0

如何备份 apt 存档缓存?如果我备份存档缓存,我可以将当​​前系统中的应用程序安装到运行相同操作系统的任何系统,使用存档文件而不需要进一步下载吗?如果是,如何进行此安装?

14.04
  • 1 个回答
  • 51 Views
Martin Hope
Praveen
Asked: 2014-11-16 09:52:13 +0800 CST

如何使用 gnome-tweak-tool 安装自定义 shell 主题

  • 2

我找到了类似的帖子,但这些答案并没有解决我的问题。我需要知道我可以在 ubuntu-gnome 中安装自定义 Shell 主题吗?如果是的话,最好的 custo shell 主题是什么?我在哪里可以得到它?在 gnome-tweak-tool 中,我无法在 shell 主题下选择任何内容。任何解决方案?我已经安装了图标主题。

gnome
  • 2 个回答
  • 9816 Views
Martin Hope
Praveen
Asked: 2014-11-16 07:30:24 +0800 CST

ubuntu-tweak 没有启动

  • 0

当我尝试在终端中运行 ubuntu-tweak 时,我得到以下信息:

adwaita@adwaita-HP-2000-Notebook-PC:~$ ubuntu-tweak

Attempt to unlock mutex that was not locked

Aborted

adwaita@adwaita-HP-2000-Notebook-PC:~$ ubuntu-tweak -d

[Launcher][DEBUG] Distribution: Ubuntu 14.04 trusty

Application: Ubuntu Tweak 0.8.8-1~trusty1

Desktop:gnome (ubuntu-tweak:84)

Attempt to unlock mutex that was not locked

Aborted

adwaita@adwaita-HP-2000-Notebook-PC:~$

现在要做什么?这是一个错误吗?

14.04
  • 1 个回答
  • 956 Views
Martin Hope
Praveen
Asked: 2014-11-06 00:36:51 +0800 CST

列出所有添加到我的系统的 ppa 存储库

  • 24

我怎样才能列出所有添加到我的系统的 ppa 存储库并将其保存到一个.txt文件中,这样我就不想花时间搜索用于全新安装的 ppa,我只需在我的.txt文件中选择一个 ppa 行并附加命令 sudo add-apt-repository?还有其他方法可以做到这一点,我不想手动提供 gpg 密钥吗?

14.04
  • 3 个回答
  • 34614 Views
Martin Hope
Praveen
Asked: 2014-11-05 01:09:12 +0800 CST

Rezising Linux 分区,其中包含 14.04 LTS 中的 ubuntu 操作系统

  • 2

在 6 个月前完成安装后,我试图/使用 ubuntu live cd 扩展我的分区。为了安装软件,我的根分区需要 9GB 的空间。根分区的大小仅为 24GB。为了找到一个安全的解决方案,我使用了我的虚拟盒操作系统,从 ubuntu 安装磁盘启动并使用 GParted 扩展根分区后,效果非常好。所以我选择冒险使用我的主机 ubuntu 14.04 LTS 版本。在启动到实时 ubuntu 14.04 cd 后,我能够删除一个 ntfs 分区,它位于我/的 ubuntu 分区之上。将我的 24GB 空间调整为 61GB 也没有出现任何错误。但是当我重新启动时,它最终出现了一个 grub 救援菜单。我试图找到解决方案,但没有任何效果。

我也做了这个:

sudo mount /dev/sda7 /mnt
sudo mount -o bind /dev/ /mnt/dev
sudo grub-install --root-directory=/mnt /dev/sda
sudo chroot /mnt /bin/bash

# Now within the chroot

sudo update-grub
exit

# Now outside chroot

这也没有帮助。请帮助。 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

14.04
  • 1 个回答
  • 361 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve