How to create a symbolic link to a command with certain argument?
When I man hexdump, it is said in the man page that "-C Canonical hex+ASCII display...Calling the command hd implies this option". Actually it is. hd equals to hexdump -C.
And then I examined the ln command but find it is a symbolic link to hexdump, just like this: /usr/bin/hd -> hexdump.
But I failed to make such a symbolic link like this. I tried: ln -s "/bin/ls -al" myls. But it didn't work.
I wonder how to make a symbolic link to a command with certain argument.
Long answer: A symbolic link is just a reference to a different file. Basically it tells the OS "You were looking for file x, but to use it please load file y". However, since every program is told it's execution name as the very first parameter (even before those you specify on the command line), it can use different behaviour based on that name. But the program itself has to support that, and short of modifying the source you can't change the behaviour.
No, the ln command has nothing to do with it. The only thing it really does is call the symlink or link function, plus some validation. After all, a program is just a file, like a text file or image.
Thank you. That's interesting. I notice that the utility BusyBox behaves in the way you mentioned.
It does, and it doesn't. Busybox can detect what name it's called with and act accordingly; a trick its developers exploited to squeeze dozens of utilities into one medium executable. What you don't see happening is any arguments in those links. As described previously, that has to be done in the shell.
Facebook had a mathematics problem which was as thus:-
6/2(1+2) = ?
Answer is 9.
My ancient Casio FX 730P mini computer written exactly as that gives 'error' only.
Now take a look at shell versions, and a python version:-
Last login: Wed Sep 14 18:04:04 on ttys000
AMIGA:barrywalker~>... (6 Replies)
hi,
I would like to ask or is it possible to dump a hex using dd from starting point to end point just like the "xxd -s 512 -l 512 <bin file>"
I know the redirect hexdump -C but i can't figure it out the combination options of dd.
Hope someone can share their knowledge..
Thanks in... (3 Replies)
I'm new to playing with the command line on OS X and am puzzled by the response I am getting from the find command. I have a file structure similar to the following
/Volumes/
../Drobo/
../../Pictures/
../../../Image 1/
../../../../Image 1.jpg
../../../../Previews/
../../../../../Image... (2 Replies)
The "hexdump" command cannot perform reverse operation. On the other hand, the "xxd" command with -r option performs reverse hexdump, while the "xxd" command without -r performs the (forward) hexdump. An example of hexdump is to convert ABCD into 41 42 43 44. An example of reverse hexdump is to... (3 Replies)
Not sure why solaris couldn't detect the geometry of a hard disk which has a working OS of winxp pro.
Is it due to the different OS that the partition information is stored in different location?
When I type '"format" it is shown as below,
c3d1 < drive type unknown>... (5 Replies)
Hi all,
One disk on my root disk group failed in Veritas Volume manager.
I replaced it with new one, initialized it and placed it with removed one.
it Synchronized plexes and everything is fine. this node was second standby node of Sun cluster. yesterday I had failure on active node with boot... (1 Reply)
#include <iostream.h>
class A
{
public:
void f(void)
{
cout << "hello world \n" ;
}
};
void main()
{
A *a;
a = 0 ;
a->f(); // OOPs...Am I mad? What am I going to do ?
} (1 Reply)
I hava been reading AUPE these days. I really am puzzled with the presentation of real user(group) ID, effective user(group) ID. How do they effect on the execution of process? What's the relationship between them? Appreciate your help. (4 Replies)