Sponsored Content
Full Discussion: sort script/command
Top Forums UNIX for Dummies Questions & Answers sort script/command Post 89776 by Chadbot on Tuesday 15th of November 2005 06:54:07 PM
Old 11-15-2005
with that i created a nice script, you will notice the scripts i make for the most part are rather 'user friendly'

Code:
 # This Script created by Chad Cope on 11/15/2005
 # Please Feel Free to place this on any system
 # you want, but keep this header intact. -Chad C.

 echo "Welcome to the file sorter, What Should I call you?"
 read name
 echo " "
 echo "Okay, $name ..."   "what is the name of the file you"
 echo "want to sort out?"  "type ONLY the files NAME"
 sleep 1
 read file
 echo " "
 echo "okay $name the file you are about to sort is called $file"
 echo "please give me a second to sort it out for you"
 echo "right now this will show you your list, re-arranged"
 echo "And then it will place it into a file all sorted out."
 sleep 1
 echo " "
 echo "What do you want the new file name to be?"
 echo "NEW FILENAME SHOULD NOT BE THE SAME AS '$file' "
 read newfile
 echo " "
 echo "SORTING $file NOW!"
 sleep 2
 echo " "
 cat $file | sort
 echo " "
 echo "now creating new file: $newfile "
 cat $file | sort > $newfile
 echo " "
 echo "Thats your list all sorted out $name"  "ENJOY!!!"
 echo "Your new file has also been created with the file name"
 echo "that you have choosen; $newfile "  "and will now be"
 echo "chmoded as chmod 744" "so others can see it"
 chmod 744 $newfile
 sleep 4
 echo "You may notice that any titles starting with 'the' or 'a' "
 echo "will get thrown into the 'T' or 'A' catagory..."
 sleep 1
 echo "I suggest you create a file like this to help sort the list"
 echo "a bit better:"
 echo " 'The nightmare before christmas'    should be:"
 echo " 'Nightmare before christmas ,The' "
 echo "             and  "
 echo " 'A man apart'  Would work best as:"
 echo " 'Man apart ,A' "
 sleep 20
 echo "just an idea...."
 echo "exiting program now"
 sleep 1
 echo "."
 # End Of File.

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sort command

i am wondering is it possible to sort a file by day of the week for example if the file is name oncall-date phone number john wednsday 00000000 jane tuesday 00000000 alice monday 00000000 kevin thursday 00000000 can it be sorted... (1 Reply)
Discussion started by: melkor
1 Replies

2. UNIX for Dummies Questions & Answers

the sort command

Explain the output of the command “sort -rfn file1 | more”. (0 Replies)
Discussion started by: wickbc
0 Replies

3. Shell Programming and Scripting

Unable to use sort command in Shell Script

Hello All, I am creating a shell script that reads a file(test.txt) with the following data, 0.0.0.0 10.10.10.0 10.10.10.1 10.10.10.10 10.10.10.2 10.10.10.3 10.10.10.4 10.10.10.5 10.10.10.6 10.10.10.7 10.10.10.8 10.10.10.9 If I use the sort, the highest value I am getting is... (1 Reply)
Discussion started by: racbern
1 Replies

4. Shell Programming and Scripting

How to Sort Floating Numbers Using the Sort Command?

Hi to all. I'm trying to sort this with the Unix command sort. user1:12345678:3.5:2.5:8:1:2:3 user2:12345679:4.5:3.5:8:1:3:2 user3:12345687:5.5:2.5:6:1:3:2 user4:12345670:5.5:2.5:5:3:2:1 user5:12345671:2.5:5.5:7:2:3:1 I need to get this: user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies

5. UNIX for Dummies Questions & Answers

sort command ... can I

Hi All, Simple question. I have a file (assumed unsorted) - can I sort said file but ignore the first two lines of the same said file (header lines) ?? Yes/No will suffice. If Yes - will keep searching. Cheers, Cam (7 Replies)
Discussion started by: Cameron
7 Replies

6. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

7. Shell Programming and Scripting

Is it Possible to sort a list of hexadecimal numbers using "sort" command?

Hello Everybody :) !!!. i have question in mind, is it possible to sort a list of hexadecimal numbers using "sort" command? (9 Replies)
Discussion started by: Kesavan
9 Replies

8. Shell Programming and Scripting

Help to sort out... Possible use of sort command

I have an input like 4.3.6.66 4.3.6.67 4.3.6.70 4.3.6.25 4.3.6.15 4.3.6.54 4.3.6.44 4.3.6.34 4.3.6.24 4.3.6.14 4.3.6.53 4.3.6.43 4.3.6.49 4.3.6.33 4.3.6.52 4.3.6.19 4.3.6.58 4.3.6.42 (5 Replies)
Discussion started by: dnam9917
5 Replies

9. UNIX for Beginners Questions & Answers

Wget, grep, sort, sed in 1 command/script

Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below. wget -q -r -l1 URL ^^ can't use -O - here and pipe | to grep because of -r grep -hrio "\b\+@\+\.\{2,4\}\+\b" * > first.txt ^^ Need to grep the output... (14 Replies)
Discussion started by: p1ne
14 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 04:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy