Sponsored Content
Top Forums Shell Programming and Scripting how to list files and execute an action? Post 302362580 by ilikecows on Friday 16th of October 2009 01:50:47 PM
Old 10-16-2009
A simple for loop is what you need. This will take each value ls outputs, (Do not use -l)assigns it to the variable of x, and executes the commands between do and done.

Code:
# for x in `ls`
> do
> some_command $x
> another_command $x
> done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in searching 2 files for strings then perform an action

I have 2 files. I basically want to search both of them to see if the 1st column ($1) matches and if it matches then check to see if the 2nd column ($2) matches, then execute some code showing the results of the matches. File 1: AAA 123 misc blah BBB 456 CCC 789 File 2: ... (2 Replies)
Discussion started by: streetfighter2
2 Replies

2. UNIX for Dummies Questions & Answers

how to use expect - send to execute list of commands inside a file

:)hello people i am working on some kind of PBX and i have list of telephone numbers inside a file, i have to insert these numbers into the correct command and then telnet to a remote server and execute these commands. i can read the telephone numbers and insert them into the command with no... (0 Replies)
Discussion started by: auma78
0 Replies

3. Shell Programming and Scripting

sort the files based on timestamp and execute sorted files in order

Hi I have a requirement like below I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory My files looks like this PGABOLTXML1D_201108121235.xml... (1 Reply)
Discussion started by: saidutta123
1 Replies

4. Shell Programming and Scripting

How to access files from different directories and to perform search action in those files?

Hi, I want to access files from different directories (for example: /home/dir1/file1 , /home/dir2/file2 ...) Like this i have to access these files(file1, file2...). (3 Replies)
Discussion started by: bangarukannan
3 Replies

5. Shell Programming and Scripting

sed cannot execute [Argument list too long]

Hi All, This question has been asked many times, but my problem is slightly different. In my shell script i am connecting to oracle database and loading the results to .dat file. This .dat file is later used to create to .xls file Some times the size of .dat file becomes more than 120000... (8 Replies)
Discussion started by: galaxy_rocky
8 Replies

6. Shell Programming and Scripting

awk script to perform an action similar to vlookup between two csv files in UNIX

Hi, I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files. Here are the contents of the two files: File 1: Date,ParentID,Number,Area,Volume,Dimensions 2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies

7. Shell Programming and Scripting

Find files and execute commands on these files (advanced)

So, I need to find a bunch of files and delete them (this example, but sometimes I need it for something else) and my trusty go-to command has always been: find . -type f -name '*file*' | xargs -I## rm '##' Works wonders... But: touch file\ file\'.txt touch file.txt touch file\ file.txt... (6 Replies)
Discussion started by: Mr.Glaurung
6 Replies

8. Shell Programming and Scripting

Find list of files missing read & execute permission

Hi, I'm writing a post-upgrade script and I want to find which files don't have read and execute to everyone. I can run a find . ! -perm, but then I have to use a list of the possible permissions (777,775, 755 etc). Is there a more elegant solution? Thanks (2 Replies)
Discussion started by: Catullus
2 Replies

9. UNIX for Beginners Questions & Answers

Action on all files in a folder

How can I do an action to all files in a specific folder? Do I use ls and a loop or something else? Does ls take folder location? (2 Replies)
Discussion started by: locoroco
2 Replies
WORD-LIST-COMPRESS(1)					 Aspell Abbreviated User's Manual				     WORD-LIST-COMPRESS(1)

NAME
word-list-compress - word list compressor/decompressor for GNU Aspell SYNOPSIS
word-list-compress c[ompress] | d[ecompress] DESCRIPTION
word-list-compress compresses or decompresses sorted word lists for use with the GNU Aspell spell checker. COMMANDS
-c, c, compress compress the plain text word list read from standard input. -d, d, decompress decompress the compressed word list read from standard input. EXAMPLES
Here are a few examples of how you can use word-list-compress word-list-compress d <wordlist.cwl >wordlist.txt Decompress file wordlist.cwl to text file wordlist.txt word-list-compress c <wordlist.wl >wordlist.cwl 2>errors.txt Compress wordlist.wl to wordlist.cwl and send any error messages to a text file named errors.txt LC_COLLATE=C sort -u <wordlist.txt | word-list-compress c >wordlist.cwl Sort a word list, then pipe it to word-list-compress to create a compressed binary wordlist.cwl file. word-list-compress d <words.cwl | aspell create master ./words.rws Decompress a wordlist, then pipe it to aspell(1) to create a spelling list. Please check the aspell(1) info manual for proper usage and options. TIPS
Word-list-compress is best used with sorted word list type files. It is not a general purpose compression program since the resulting files may actually increase in size. Word-list-compress accepts up to 255 text characters in the range of {0x21...0xFF}. If your word list requires a larger character set for certain languages or longer length for multi-word, scientific, medical, technical or other use, then it is recommended that you compress your word list using prezip-bin(1) DIAGNOSTICS
Word-list-compress normally exits with a return code of 0. If it encounters an error, a message is sent to standard error output (stderr), and word-list-compress exits with a non-zero return value. Error messages are listed below: (display help/usage message) Unknown command given on the command line so word-list-compress displays a usage message to standard error output. Corrupt Input This is only for the decompression command d. The input file is of an unknown format or the input file/stream is corrupted. You may have some valid output, but word-list-compress could not complete the process. If the input file is a compressed wordlist but you have no output file, then it may be a newer prezip-bin(1) version of compressed file, if so, try decompressing the file with prezip-bin(1) instead. Output Data Error The output is full, write protected, or has an error and can no longer be written to. SEE ALSO
aspell(1), aspell-import(1), prezip-bin(1), run-with-aspell(1) Aspell is fully documented in its Texinfo manual. See the `aspell' entry in info for more complete documentation. REPORTING BUGS
For help, see the Aspell homepage at <http://aspell.net> and send bug reports/comments to the Aspell user list at the above address. AUTHOR
This manual page was written by Aaron Lehmann <aaronl@vitelus.com>, Brian Nelson <pyro@debian.org> and Jose Da Silva <digital@joescat.com>. GNU
2005-09-05 WORD-LIST-COMPRESS(1)
All times are GMT -4. The time now is 07:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy