Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sq(1) [freebsd man page]

SQ(1)							      General Commands Manual							     SQ(1)

sq, unsq - squeeze or unsqueeze a sorted word list SYNOPSIS
sq < infile > outfile unsq < infile > outfile DESCRIPTION
sq compresses a sorted list of words (a dictionary). For example: sort -u /usr/share/dict/words | sq | gzip -9 > words.sq.gz will compress dict by about a factor of 5. unsq uncompress the output of sq. For example: gunzip < words.sq.gz | unsq | sort -f -o words will uncompress a dictionary compressed with sq. The squeezing is achieved by eliminating common prefixes, and replacing them with a single character which encodes the number of characters shared with the preceding word. The prefix size is encoded as a single printable character: 0-9 represent 0-9, A-Z represent 10-35, and a- z represent 36-61. BUGS
sq and unsq can only handle words of up to 256 characters. The input must be sorted, and duplicates must be suppressed. AUTHOR
Mike Wexler SEE ALSO
compress(1), sort(1). LOCAL SQ(1)

Check Out this Related Man Page

look(1) 						      General Commands Manual							   look(1)

look - Finds lines in a sorted list SYNOPSIS
look [-df] [-tcharacter] string [file] The look command prints all lines in a sorted file that begin with string. OPTIONS
Uses dictionary order; only letters, digits, tabs, and spaces are used in comparisons. Searches without regard to case; treats uppercase and lowercase as equivalent. Ignores character and characters following it in the search string. If you specify look -tC ABCDE, the string ABCDE would become (in effect) AB, with CDE being ignored. This option is primarily for shell scripts, in which more than one string is being processed. DESCRIPTION
If no file is specified, look searches in the system word list /usr/share/dict/words, with the options -df assumed by default. The look command uses binary search. The -d and -f options affect comparisons as in sort. NOTES
In order to use the -f option, you must first sort file with the sort -f command; otherwise, look displays only lowercase items. If you do not specify -f, but specify a file (such as /usr/share/dict/words) that has been sorted with sort -f, look may not produce any output. EXAMPLES
To search a sorted file called sortfile for all lines that begin with the string as, enter: look as sortfile To search the system word list for all words beginning with smi, enter: look smi This might result in: smile smirk smith smithereens Smithfield Smithson smithy smitten FILES
System word list. SEE ALSO
Commands: grep(1), sort(1), spell(1) look(1)
Man Page

12 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unmatched 'then'

I am having a problem with the following statement in a korn shell script: if "$all_recs" = "ALL"; then commands fi; I keep getting the error syntax error at line 999 : 'then' unmatched. I'm sure it is a minor problem, but have been unable to find any answers online. Any help... (22 Replies)
Discussion started by: akpopa
22 Replies

2. Shell Programming and Scripting

can nested SQl be run in Unix Script?

can nested SQl be run in Unix Script? I tried some and found only simply sql(one select) can work well in unix script. (21 Replies)
Discussion started by: YoYo
21 Replies

3. UNIX for Dummies Questions & Answers

Problem with while loop and SQL

Connected to oracle database sqlplus << EOF $CONNECTSTR set heading off set trimspool on set feedback off select ID,DATE from sysadm.TEST where VALUE = 'A' order by ID; value_id = ID value_date = DATE EOF 1. Is it possible to reference the values, ID,DATE in unix shell script. 2.... (20 Replies)
Discussion started by: nandajk
20 Replies

4. Shell Programming and Scripting

Something went awfully wrong in PHP+MySQL :(

When I'm running a few statements through mysql console, they are working just fine but when I'm trying to write some logic in php and trying to execute it, its awfully slow.. Its perhaps performing, 10 queries in 20 seconds... :( Why is this happening? My table structures are: Name:... (23 Replies)
Discussion started by: Legend986
23 Replies

5. Shell Programming and Scripting

Shell script to catch PL/SQL return values

I tried searching the forum for similar posts but its closed now. Would appreciate any help on this. I am trying to capture return value from a select query into a variable. DB is Oracle I am able to spool it to a file but I donot intend to use it. Here is my script that does not work ;) I... (27 Replies)
Discussion started by: monie2717
27 Replies

6. Shell Programming and Scripting

Connecting to Oracle DB using sqlplus

Hi, I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following: 1. Connect to oracle database hosted on a different server 2. fire a query on the oracle db 3. store the output in a variable 4. use this variable for further logic... (26 Replies)
Discussion started by: shrutihardas
26 Replies

7. Shell Programming and Scripting

Select record with MAX value in MySQL

Hi there, I have trouble selecting record that contain one biggest value for a group of other values. I mean, this is my table: mysql> SELECT * FROM b; +----+------+-------+ | id | user | value | +----+------+-------+ | 1 | 1 | 100 | | 3 | 1 | 150 | | 5 | 1 | 300 | | 6... (20 Replies)
Discussion started by: chebarbudo
20 Replies

8. Shell Programming and Scripting

Read a CSV file and generate SQL output

Friends, This is what I need: I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location. I'm new to Shell scripting. I'm currently working on a... (25 Replies)
Discussion started by: Ram.Math
25 Replies

9. OS X (Apple)

A Fun Perfect Square Checker Using Integer Arithmetic Only... ;o)

A recent Python upload on another site gave me the inspiration to do an unusual bash version... This is a little tongue-in-cheek but an enjoyable bit of fun. It took around 11 seconds to prove 90000000000 had a perfect square of 300000... It is a stand alone program and has a degree of... (23 Replies)
Discussion started by: wisecracker
23 Replies

10. Post Here to Contact Site Administrators and Moderators is slow today ???

Hi, Just wanting to know if there is any issues today with the site. Initially I thought it is my internet connection or computer but regardless which one I use, the site has been slow and it is also not showing with the right fonts etc. I've been trying for the last 12+ hours and it's always been... (21 Replies)
Discussion started by: newbie_01
21 Replies

11. UNIX for Beginners Questions & Answers

CentOS 6 ran out of space, need to reclaim it

Hello everyone, I am having an issue here with CentOS release 6.6 (Final) that shows all of the space used up, but I can't tell where the space went. Seemingly I am using up 100%, according to df -h Filesystem Size Used Avail Use% Mounted on... (27 Replies)
Discussion started by: DannyBoyCentOS
27 Replies

12. What is on Your Mind?

Debugging Our Computer Science Trivia Feature

Only a few days after I coded this new feature from scratch, we are seeing over 3000 entries in the database from members (mostly guests) playing CS trivia. I have spend a lot of time coding this (from scratch) and testing the API. From the logs, it seems to have an API bug which appears... (31 Replies)
Discussion started by: Neo
31 Replies