The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
simple shell - how to get a parameter typed in a shell script cmitulescu Shell Programming and Scripting 4 01-09-2009 08:45 PM
Help need to make a shell script run for ffmpeg vhook watermaking in shell wingchun22 Shell Programming and Scripting 1 09-27-2008 07:52 AM
Linux Shell Question: how to print the shell script name ? meili100 UNIX for Dummies Questions & Answers 3 07-01-2008 02:55 PM
How to Start a Shell as Login shell instead of ordinary shell Sivaswami Linux 3 07-01-2008 02:52 PM
Difference between writing Unix Shell script and AIX Shell Scripts haroonec AIX 0 04-12-2006 03:27 AM

Reply
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 07-06-2009
Masanamuthu Masanamuthu is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 13
You can try ckyorn binary....

#!/usr/bin/ksh
echo "test"
VAR=`ckyorn -d y -p "Do want to process it"`
if [ $answer = "y" -o $answer = "Y" ] then
cat/etc/passwd
who | who -l
ps -e | wc -l
fi

---------- Post updated at 11:32 AM ---------- Previous update was at 11:29 AM ----------

Sorry, small change

#!/usr/bin/ksh
answer=`ckyorn -d y -p "Do want to process it"`
if [ $answer = "y" -o $answer = "Y" ] then
cat/etc/passwd
who | who -l
ps -e | wc -l
fi

Use this if it fulfills your requriement
  #2 (permalink)  
Old 07-10-2009
Producer Producer is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 10
I post exact what I have


Code:
echo "I will now continue to help"
echo "Would you like to know some helpful information about your system"
echo -n " Yes or No: "
read answer
if [ $answer = "y" -o $answer = "Y" ] then
 cat /etc/passwd | wc -l
 who | wc -l
 ps -e | wc -l

  #3 (permalink)  
Old 07-10-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Quote:
Originally Posted by Producer View Post
I post exact what I have


Code:
echo "I will now continue to help"
echo "Would you like to know some helpful information about your system"
echo -n " Yes or No: "
read answer
if [ $answer = "y" -o $answer = "Y" ] then
 cat /etc/passwd | wc -l
 who | wc -l
 ps -e | wc -l
where's the matching 'fi' for the 'if'?
Also you need ']; then' if 'then' appears on the SAME like with 'if'.
  #4 (permalink)  
Old 07-10-2009
Producer Producer is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 10
Very new Could you possibly break it down little further
  #5 (permalink)  
Old 07-10-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131

Code:
echo "I will now continue to help"
echo "Would you like to know some helpful information about your system"
echo -n " Yes or No: "
read answer
if [ $answer = "y" -o $answer = "Y" ]; then
 wc -l < /etc/passwd
 who | wc -l
 ps -e | wc -l
fi

  #6 (permalink)  
Old 07-10-2009
Producer Producer is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 10
You sir kick <blip-blip>

Thank you ,

No idea why I missed the ( ; )

Ughhh Thank you

Last edited by vgersh99; 07-10-2009 at 08:45 PM.. Reason: no profanity please
  #7 (permalink)  
Old 07-10-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Hello!

In case you forgot to read the forum rules, here is quick copy.

Quote:
RULES OF THE UNIX AND LINUX FORUMS


(1) No flames, shouting (all caps), sarcasm, bullying, profanity or arrogant posts.

(2) No negative comments about others or impolite remarks. Be patient.

(3) Refrain from idle chatter that does not contribute to the knowledge base. This does not apply to the forums in The Unix Lounge which are for off-topic discussions.

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.

(5) Search the forums database with your keywords before asking.

(6) Do not post classroom or homework problems.

(7) No job postings from headhunters or recruiters except in The Unix Forums Job Board. See How to Post to The UNIX Forums Job Board for information on using the Job Board.

(8) No BSD vs. Linux vs. Windows or similar threads.

(9) Edit your posts if you see spelling or grammar errors (don't write in cyberchat or cyberpunk style). English only.

(10) Don't post your email address and ask for an email reply. Don't send a private message with a technical question. The forums are for the benefit of all, so all Q&A should take place in the forums.

(11) Post questions with descriptive subjects. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

(12) These are not hacker boards so hacker related posts will be promptly deleted or moderated.

(13) The forum administrators reserve the right to prune, move or edit posts that do not adhere to the rules or are technically inaccurate.

(14) The forum administrators reserve the right to remove users or change their posting status to read only without notice if any rules are not followed.

(15) No smoking in the forums.
Cheers.

The UNIX and Linux Forums
Reply

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:37 AM.


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