我想以myscript这种方式调用文件:
$ ./myscript -s 45 -p any_string
Run Code Online (Sandbox Code Playgroud)
要么
$ ./myscript -h #should display help
$ ./myscript #should display help
Run Code Online (Sandbox Code Playgroud)
我的要求是:
getopt 这里得到输入参数-s存在,如果没有返回错误-s是45还是90-p存在并且之后有输入字符串./myscript -h或只是./myscript显示帮助我到目前为止尝试了这段代码:
#!/bin/bash
while getopts "h:s:" arg; do
case $arg in
h)
echo "usage"
;;
s)
strength=$OPTARG
echo $strength
;;
esac
done
Run Code Online (Sandbox Code Playgroud)
但是使用该代码我会收到错误.怎么用Bash和getopt?
这段代码有效吗?
<a href="#" onclick="<?php session_destroy();?>">Logout</a>
Run Code Online (Sandbox Code Playgroud) TL;DR:我已经保存了一个文件,我需要以前的版本。我该怎么办?
我有很多代码,剪切它们 ( ctrl+x),并想将它们粘贴到 VS code 崩溃的其他地方。我再次打开它,复制了一些其他行,然后轰隆隆!我无法访问第一条剪切线。有什么办法可以让他们回来吗?
笔记:
我没有犯下这些罪行。
由于持续崩溃,我安装/卸载了 VScode 2-3 次,甚至安装了,但VS-insiders 我为所有以前的 VScode 安装保存了以前的数据文件,例如目录.vscode中的文件夹C:\Users\User或Code目录下的文件夹C:\Users\User\AppData\Roaming\Code(全部都是今天的)。
我阅读了这样的链接,但我的文件已保存。它们没有保存在该backup文件夹中。
VS被配置为自动保存文件(延迟后),所以我不ctrl+s手动按。
我启用了 git,这有帮助吗?顺便说一句,该文件已暂存。
我使用CTRL+ Click(或F12)在 vscode 中搜索并打开定义。问题是我的文件被复制到另一个在sketch编译代码时调用的目录,所以当我想打开函数的定义时,VS 显示两个文件(文件夹中的真实文件和复制文件sketch),有时我编辑错误地复制了文件!
如何从“转到定义”中排除某些文件夹?
当我输入此命令时:
$ find . -perm 777 -maxdepth 1
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
find: warning: you have specified the -maxdepth option after a non-option argument -perm, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
这意味着什么?