[H-GEN] Formatting of ls (grep??)

Paul Clarke paul at sitedynamics.com.au
Sun Apr 18 06:07:38 EDT 2004


Hi all, 

Another simple one form a newbie.

I am writing a script and want it to display some info from the output
of a ls command. I will then be asking the user to enter the number of
one of the results.

The entries from the la -la that I want to display all have the name in
the format of a domain and basically look like:

lrwxrwxrwx 1 root root 23 Jul 10 2003 sitedynamics.com.au ->
home/virtual/site4/fst

Ideally I want to display just these lines as:
4 sitedynamics.com.au

So that the user then inputs 4 if that is the site that they want. The 4
comes from the siteX in the path.

I expect that it is a grep command that I have to use but I can't jag
the command. In fact every time I run a grep command I need to <ctrl><D>
to get back to the prompt, which is obviously going to stuff up a
script.

Thanks

Paul

Site Dynamics - Paul Clarke
paul at sitedynamics.com.au
0414 367 747





More information about the General mailing list