The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Extracting specific info from finger command franny UNIX for Dummies Questions & Answers 1 12-05-2007 01:13 PM
help in finger command. shanshine Shell Programming and Scripting 1 06-06-2007 12:10 PM
finger command qfwfq UNIX for Advanced & Expert Users 10 11-21-2006 05:42 PM
How to input username on text file into finger command on shell script Micz Shell Programming and Scripting 3 11-08-2005 02:38 AM
finger djatwork UNIX for Dummies Questions & Answers 5 11-12-2001 01:18 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-02-2003
apolishuk apolishuk is offline
Registered User
  
 

Join Date: Dec 2003
Location: Richmond, VA
Posts: 3
Using the Finger command in a Script

This is my senario.....

The user enters a userid into linux.
((I have have already scripted the command to read this userid.))

I need help in writing the script so It reads the userID and in conjuction w/ the finger command displays to the user "no plan" on the screen (so the user reads/sees "no plan"). I hope I am explaining this good enough. Im a beginner. Please help!

Thanks
Aaron
  #2 (permalink)  
Old 12-02-2003
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
  
 

Join Date: Nov 2003
Location: Maryland
Posts: 449
Are you doing this remotely or locally? If locally, why use finger? All it is doing is outputing the contents of the users $HOME/.plan file. Please explain what you are actually trying to do - why the contents of plan? - Nice to see someone else from Richmond here.

Cheers,

Keith
  #3 (permalink)  
Old 12-02-2003
apolishuk apolishuk is offline
Registered User
  
 

Join Date: Dec 2003
Location: Richmond, VA
Posts: 3
Im currently in my first Unix class. The teacher wants us to write out a script using the unix info. we have learned so far. Im a beginner, so I will explain this the best way I can, please bear w/ me....thanks for your time :-)
I am doing this locally looking on a local college server.

This is the Script I am have trouble writing.

After the user enters in his/her userid, I need to look in that users $Home/.plan file and have just the words "no plan"
appear on the screen. It should be a simple one line script to do this, but I have no clue....I hope this explianation helps....

Thanks so much!
Aaron
  #4 (permalink)  
Old 12-02-2003
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
  
 

Join Date: Nov 2003
Location: Maryland
Posts: 449
In the future, be sure to read the rules that go along with the forums. Homework questions are not supposed to be posted to the forums. For this instance if you are having that happen at the time of the user's login, you could actually just add the following to the user's profile:

if [ -f $HOME/.plan ]
then
cat $HOME/.plan
else
echo "no plan"
fi

Cheers,

Keith
  #5 (permalink)  
Old 12-02-2003
apolishuk apolishuk is offline
Registered User
  
 

Join Date: Dec 2003
Location: Richmond, VA
Posts: 3
I did not realize the homework question thing...sorry.
Thank you very much for your time. I will try that script when I get home tonight.

Thanks for all your help!!

Aaron
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0