Script - Urgent Help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script - Urgent Help
# 1  
Old 06-01-2006
Script - Urgent Help

Hi guys, i really need some urgent help on a few things

I'm an extreme unix novice,

Can you guys please help me with a couple of questions.

I am in no way asking anyone to do it for me, but i am really asking for some extremely in depth help. I know alot of this is very second nature to you guys, from jsut reading over the forums. I am finding it impossible.


My question is:

i have to Print all the processes that are currently running, by invoking ps, and sort them in reverse order using the COMMAND column of the output as the key.

This can't be hard, but i cannot do it no matter what i try.

Please, if anyone can help it would be greatly appreciated.
# 2  
Old 06-01-2006
Quote:
Originally Posted by troy86
Hi guys, i really need some urgent help on a few things

I'm an extreme unix novice,

Can you guys please help me with a couple of questions.

I am in no way asking anyone to do it for me, but i am really asking for some extremely in depth help. I know alot of this is very second nature to you guys, from jsut reading over the forums. I am finding it impossible.


My question is:

i have to Print all the processes that are currently running, by invoking ps, and sort them in reverse order using the COMMAND column of the output as the key.

This can't be hard, but i cannot do it no matter what i try.

Please, if anyone can help it would be greatly appreciated.
Is it an assignment ?
# 3  
Old 06-01-2006
I work for a web design company in Bendigo, and im trying to learn it myself through some online tutorials etc. i don't learn it at uni or anything, i'm finished all that.

Not really an assignment, as it's not.. due or anything, but it is work that i want to do.

This isn't gonna be a once off, im sure this will be one of many annoying questions ill be asking over the next few months while i learn it.

Can you help me with figuring it out ?


One more question while im here.

how do you Print a long listing of the files in a specified directory for a specific month, my specified directory i assume is just ../troysunix

So i have to have a menu i suppose where i can input which month i want to check.

Eg. Feb, and it will show me the files that were in ../troysunix for the month of feb?

But i cant figure out how for the life of me.
# 4  
Old 06-01-2006
Quote:
Originally Posted by troy86
i have to Print all the processes that are currently running, by invoking ps, and sort them in reverse order using the COMMAND column of the output as the key.
Code:
ps -axeo comm,pid | sort -r

# 5  
Old 06-01-2006
Thankyou so much, now i've gotta try and get that into my script.

how do you Print a long listing of the files in a specified directory for a specific month, my specified directory i assume is just ../troysunix

So im making a menu, i suppose where i can input which month i want to check.

Eg. Feb, and it will show me the files that were in ../troysunix for the month of feb?

But i cant figure out how for the life of me.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

3. Shell Programming and Scripting

I want an urgent script

Hi I want a script which reads a file and ftped the content of that file into another server.The file saved in new location as filename.date (3 Replies)
Discussion started by: Renjesh
3 Replies

4. Shell Programming and Scripting

sed script help urgent

Collegues I am dealing with raw text files which is extracted from web pages. I have to find sentances which contains more than 99 words and have to put a "." after the 99th or 98 th word . Is there any possiblity to it in sed or awk With regards Jaganadh.H (5 Replies)
Discussion started by: jaganadh
5 Replies

5. UNIX for Dummies Questions & Answers

Urgent Script Needed

I need shell script code for the following 1. Read syscat.columns after connecting to DB2 using SQL cursor 2. Read the output of the previous SQL command in the shell script 3. Perform insertions and deletions in the output of step 1 Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

6. Shell Programming and Scripting

[urgent need help] unix script....

hi experts, i'm new in scripting unix i have some problem with my script below is shown my script : #!/bin/sh BASEDIR=/export/home/mapadm BINDIR=$BASEDIR/bin LOGDIR=$BASEDIR/log TDRDIR=$LOGDIR/TDR BACKUPDIR=/data/log export BASEDIR BINDIR LOGDIR TDRDIR BACKUPDIR YEAR=`date '+%Y'`... (21 Replies)
Discussion started by: bucci
21 Replies

7. Shell Programming and Scripting

[urgent need help] about script

hi experts, i'm new on scripting on solaris 8 sparc, need some advices. i have some data in a file like : 20061221 163826.485 20061221 163925.144 058.659 6123456789012 00000E8A 047 08 002 465 00010022 510105642138069 20061221 163915.163 20061221 163925.336 010.173 6123456789012 00000F4F... (6 Replies)
Discussion started by: bucci
6 Replies

8. Shell Programming and Scripting

Need a Script(Urgent)

sdfggggggggggggggggggggg (7 Replies)
Discussion started by: udayben
7 Replies
Login or Register to Ask a Question