Creating commands from ls output

Creating commands from ls output

Post by Greg Akin » Wed, 02 Jul 2003 10:01:30

I would like to pipe the results of an ls so that the output is a series
of commands.

The ls returns a list of .mpg files... And I would like the output to be

%mpg123 -w blahblah.wav "blah blah.wav"

Notice that the spaces from windows filenames are removed.

Maybe something like ls | xargs mpg123 ?

But I'm not sure after that..

Any help would be appreciated.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


1. LS command question (How do I omit the LINK field from the output of the command)?


I wanted to ask a question about the LS command in unix (solaris).

I want the LS command to omit the "link" field in it's output!


this is the output of the command "ls -al":

drwxr-xr-x   2 root     other        512 Dec 25  2001 tmp1

I want the second field omitted in the output, just like this:

drwxr-xr-x   root     other        512 Dec 25  2001 tmp1

How do I accomplish this?

Does anyone have a short script that does this?

Is there a command that selects a field or more than one field in a
line and can remove it?

Thanx alot for your time!


2. Migration Question

3. formatting ls's output to create script files

4. Linux Sound

5. Sorting output of 'ls' command by file extension?

6. /var/logfiles

7. Solaris 2.5 command ls -o output

8. Another Newbie? (Lilo)

9. ls command with LINUX-like color output

10. ls color highlighting as in the ls command in the slackware distribution

11. ls command gives "Out of memory for ls" error

12. 4.3.2 Man command outputs 81 column output?

13. /usr/bin/ls /usr/ucb/ls /usr/local/bin/ls