how to pass command line arguments to strace?

how to pass command line arguments to strace?

Post by Icarus Sparr » Sun, 11 Dec 2005 09:21:16



(nothing more than the question in the subject line).

The answer is "in the normal unix way", e.g

strace -o /tmp/ls.trace ls -l
^^^^^^ The strace command
       ^^^^^^^^^^^^^^^^ options for strace
                        ^^ The command to be traced
                           ^^ options for the command being traced

 
 
 

1. How can I pass a command line argument to an aliased command?

How can I pass a command line argument to an aliased command?

In this example, I want to pass a candidate directory name as a command line
argument and have it processed by the "dir" alias script.

For example:

arvant02:/opt/vantive8> alias dir='ll -F omu | egrep ^d '
arvant02:/opt/vantive8> dir
drwxrwxr-x       2 vantive    dba           2048 Aug  9  2001 apps_ora8/
drwxrwxrwx       2 vantive    dba           2048 Apr 26 11:46 backup/
drwxrwxrwx       2 oracle     dba             96 Oct  9  2001 core_22352/
drwxrwxrwx       2 vantive    dba           2048 Apr 26 11:38 data/
drwxrwxrwx       2 vantive    dba           4096 Apr 26 11:46 log/
drwxrwxr-x     8 vantive    dba             96 Aug  9  2001 movebinary/
drwxrwxr-x   3 vantive    dba             96 Apr 26 11:32 omudata/
drwxrwxr-x   2 vantive    dba           2048 Aug  9  2001 views/
arvant02:/opt/vantive8>

The above alias lists those directories belonging to the subdirectory omu.
I hardcoded the "omu" directory into the dir alias script.

If,however, I want to replace the hardcoded "omu" subdirectory value with a
variable that I pass in as a command line argument to the alias command
"dir", such as, dir sub_dir <enter>, how would I alter the alias script to
enable this?

Mark

2. Apache

3. How to pass reg exp as command line argument in shell script?

4. Obtaining RPMs

5. Passing command-line arguments

6. dtmail error

7. passing command line arguments to RPC server(again)

8. Help using Linux as router

9. passing command line arguments to RPC server

10. "pidof" on a process (which was ran by passing arguments from the command line)

11. AWK: How to pass command line arguments to awk

12. CGIwrap 2.6 is available - fixes cmd line argument passing

13. reading a line from a file and passing it as an argument