unix

Is it possible to edit a symlink with a text editor?

a 夏天 提交于 2020-08-22 08:44:35
问题 When we create a symlink, the number of bytes the symlink takes up is exactly the length of the origin it points to. For instance, $ ln -s dest link1 $ ln -s longer_dest link2 $ ls -l lrwxrwxrwx 1 username 4 Mar 26 20:21 link1 -> dest lrwxrwxrwx 1 username 11 Mar 26 20:21 link2 -> longer_dest where link1 takes up 4 bytes, which is the length of dest ; link2 takes up 11 bytes, which is the length of longer_dest . Therefore, symlinks are in fact no more than the destination path stored in plain

Define alias that references other aliases

你说的曾经没有我的故事 提交于 2020-08-22 04:34:31
问题 I'd need to be able to define an alias in a Debian shell that includes other aliases, for a project I'm currently working on. Let's look at a code example to make things more clear. alias foo=foo alias bar=bar If I run type foo it returns foo is aliased to 'foo' , and type bar returns bar is aliased to 'bar' . Up to here all fine. Now, where I'm having the problem. alias foobar=$foo$bar Doesn't work. type foobar returns foobar is aliased to '' . I've tried alias foobar=${foo}${bar} and it

Define alias that references other aliases

半世苍凉 提交于 2020-08-22 04:32:52
问题 I'd need to be able to define an alias in a Debian shell that includes other aliases, for a project I'm currently working on. Let's look at a code example to make things more clear. alias foo=foo alias bar=bar If I run type foo it returns foo is aliased to 'foo' , and type bar returns bar is aliased to 'bar' . Up to here all fine. Now, where I'm having the problem. alias foobar=$foo$bar Doesn't work. type foobar returns foobar is aliased to '' . I've tried alias foobar=${foo}${bar} and it