display the actual number of bash command interpreter


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting display the actual number of bash command interpreter
# 1  
Old 05-05-2011
display the actual number of bash command interpreter

Hello everybody!
I have a problem "Write script, which will display the actual number of bash command interpreter, working in the operating system." I used ps command to list all process running in the system but I don't know how to select only bash command interpreter. Pls give me some ideas.
# 2  
Old 05-05-2011
Try:
Code:
ps <your flags>| grep -w bash| grep -v grep| wc -l

This User Gave Thanks to zaxxon For This Post:
# 3  
Old 05-05-2011
Code:
pgrep bash|wc -l

# 4  
Old 05-09-2011
Ok. tks so much!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

-bash: ./p4: /bin/ksh^M: bad interpreter: No such file or directory

I keep getting this error and I am not sure why. -bash: ./p4: /bin/ksh^M: bad interpreter: No such file or directory First I run my makefile and this works fine: goodmain: main.o gcc -o goodmain main.o main.o: main.c gcc -c main.c Then I want to limit my output so I... (11 Replies)
Discussion started by: cokedude
11 Replies

2. Shell Programming and Scripting

Bash Command To Delete Number from Array

Hi, I am writing a script to split a log file - the log could contain multiple days worth of logs. The second line of the log contains the string "Version ". In my test log which comprises of two days worth of logs, this string appears twice - once each day. Essentially I would like to split... (7 Replies)
Discussion started by: pmurray21
7 Replies

3. Shell Programming and Scripting

creating own command interpreter like bash...??

Hello senior members, I am a fairly newbie here. I just want to ask one question that how can once create one's own command interpreter/ shell like bash in unix/linux. I need to execute basic commands like pipes and i/o. Any help in this matter ?? (3 Replies)
Discussion started by: duma188
3 Replies

4. Shell Programming and Scripting

need to add user from command prompt not to open actual file

Here is my script which gives the below output when I run.First it will display the list of all groups and then ask for enter the group name and after it will ask for contribuotors or users then I will add contribuotirs or users and it will show the list of all users associated with that group but... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies

5. Shell Programming and Scripting

Display Specific line number using tail command

Hi , 1)i want to display specific line number using tail command. e.g. display 10 line from end. Please help... 2)Want to display line 10 to 15 (from end)using tail command) (2 Replies)
Discussion started by: vivek1489
2 Replies

6. Shell Programming and Scripting

How to capture actual error message when a command fails to execute

I want to capture actual error message in case the commands I use in my shell script fails. For eg: ls -l abc.txt 2>>errorlog.txt In this case I understand the error message is written to the errorlog.txt and I assume its bacause the return code from the command ls -l abc might return 2 if... (3 Replies)
Discussion started by: prathima
3 Replies

7. AIX

run which command to check the actual user

hi gurus, i have a question: when run which javac under a user account I got the following results: PROD DB Server: /usr/java14/bin/javac DR DB Server: /usr/java14/bin/javac DEV DB Server: /usr/java5_64/bin/javac The .profile in all environments are same. so how do know who is the... (1 Reply)
Discussion started by: lweegp
1 Replies

8. UNIX for Dummies Questions & Answers

an command interpreter

if somebody can help me pls. i need the source code for a shell which compiles C or java programs. i need a very short and simple one, just for the compiling part, in UNIX Respect (4 Replies)
Discussion started by: zlatan005
4 Replies

9. Shell Programming and Scripting

to print number one less than actual number

suppose we have a file which contains 34 45 56 77 55 66 54 67 so output shud be like 33 44 55 76 54 65 53 66 (4 Replies)
Discussion started by: cdfd123
4 Replies

10. Shell Programming and Scripting

#!/usr/bin/ksh Command Interpreter in a sh script

Hi, I have a developer that is trying to start a script with sh "scriptname". In the script, he is specifying #!/usr/bin/ksh as the command interpreter. For some reason sh is ignoring the #!/usr/bin/ksh. We are running Solaris 8. Does anyone have any ideas what could be causing this? Here... (3 Replies)
Discussion started by: ckeith79
3 Replies
Login or Register to Ask a Question