Moment For Technology

Commands are common in shell scripts

We need to learn to use tools to free hands, such as batch to folder some files to create soft links, we can write a script to achieve. Here are some of the commands used in this project. When a variable is defined, the variable name does not have the dollar sign {code... } uses a variable that has been defined by prefixing the variable name with a dollar sign {code... } The curly braces around the variable name are optional, with or without the curly braces added to help solve...

Bash Tips 02: Construct relative paths

If my working directory is/TMP /demo/source/foo, then the path to/TMP /demo is /source/foo, and the path to/TMP /demo is /source/foo. /.. , but how do you construct such a path in a Bash script? This was a key technical issue when I was writing the GAR script, because I'm just saying that/TMP /demo is the directory for my document project. In fact, this directory doesn't...

Bash Tips 03: The Importance of Double Quotes

Suppose that in a Bash script, the function foo is defined as follows: {code... } call foo: {code... } that is, if foo is called with an empty string and "test" as the argument value, the result is {code... } Now suppose you have a function bar, defined as {code... } and then call bar, {code... } result output {code... } The reason is that bar accepts the first parameter value as an empty string, but when it passes the parameter value to foo, B...


GAR is a Bash script -- I wrote it, based on my wild Bash programming experience -- that manages Markdown document projects and converts Markdown document collections into HTML document collections. GAR works by pandoc, git, tree, and a web browser that opens the specified web file in the Shell (command line). GAR uses Firefox as the web browser by default, but it is available in the GA...

Bash Tips 01: Get the path to the script itself

When writing the GAR script, I need to determine the path of the GAR script to its own directory on the file system while it is running. Based on this path, the gar.css file can be deployed to the root of the document project, because gar.css is in the same directory as the gar.css script, which needs to find it based on its own location, otherwise the user of the gar.css script will have to provide the path to gar.css, which is inconvenient.

-bash: /bin/rm: Argument list too long

-bash: /bin/rm: Argument list is too long. Argument list is too long. Argument list is too long. The solution is to use the following command: Ls | xargs -n 10 rm - fr all ls output filename (separated with a space) xargs is the output of ls, every 10 as a set of (space as the separator), as the parameter that is all the rm - rf file name for a group of 10, by the rm - rf delete

Bash: String

One exception is \newline (backslash + newline), which is treated as a long string newline and is printed with \newline (backslash + newline) removed and ignored.

Typora Graph Bed Plug-in - Paste pictures automatically to upload to B Station

Typora-plugin-bilibili uses the path to get nodejs in the typora-plugin-bilibili plugin, which can be used to upload images to the nodejs plugin. This plugin can be used to upload images to the nodejs plugin. Mac uses which node {code... } replace the node path in to get the absolute path in index.js, and replace the indexjsPath path in to get the SESSDATA and replace the index.js...

Gitlab project migration

This article describes the migration of projects from one group to another on GitLab. 1. Clone the project that needs to be migrated to local {code... } 2. Add new remote host address first CD into clone into local project {code... } The command above adds a host address BU with the name of gitlab for the new project (the migrated project).

About (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.