Whether a string is a valid unix command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Whether a string is a valid unix command
# 1  
Old 07-20-2010
Whether a string is a valid unix command

How to find a string which is entered in command promt is a valid unix command or not?.

Thanks in advance

~Saravana
# 2  
Old 07-20-2010
Code:
which command ## shows which command is being executed
man command ## shows everything about the command.

and if the command doesnt exist on that machine it tells you. if you use man
This User Gave Thanks to dazdseg For This Post:
# 3  
Old 07-20-2010
usually by pressing Enter after you type in the string...

You could also try seeing what the system intends on doing ahead of time by trying whence, which, man, etc....any of these will give non-committal feedback in the form of either a path or a manual and give a fair notion of what might happen.
This User Gave Thanks to curleb For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check if a string is a valid timestamp in UNIX.

Hi all, I have date and time value in a string, I want to check if it is a valid date and time. Need help on this. Thanks (7 Replies)
Discussion started by: Pratiksha Mehra
7 Replies

2. Shell Programming and Scripting

[BASH] (own) command is not a valid identifier

Heya fellows Yes, script-tools and TUI are both my 'children', so i cant go anywhere (else) and ask for help/bugfixes as i need to write them myself. However i do need help to understand error messages at times (or get hints what else might cause them), so here we go: Since my new computer... (4 Replies)
Discussion started by: sea
4 Replies

3. Shell Programming and Scripting

Fetch Valid String

Hi All, How to fetch the particular row based on my search command. For example Source Column Column A Column B 001,56123456 002,57123456 003,123456 Expected Output: 003,123456 To get this output I tried below mentioned function grep '123456' filename.txt (4 Replies)
Discussion started by: suresh_target
4 Replies

4. Shell Programming and Scripting

403-009 The specified number is not valid for this command.

Error Message: dm2_oraver: 9xdm2_oraver2: LT11/w_standard/gold_wh/install/dm2_updatetns.ksh: 11MAR13: 0403-009 The spe cified number is not valid for this command. if means the line number in the ksh, it is ((CntNew=Cnt+1)). Please let me know the best way to debug and find it out. I am... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

5. Shell Programming and Scripting

0403-009 The specified number is not valid for this command

Hi, Am using a if condition to match a pattern but I get the following error.. if then echo "The value is $hidType" return 0 elseif -a ] echo "The value is $hidType" return 0 fi I get the following error + echo The value is mode The value is mode + ./a2: mode:... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

6. Shell Programming and Scripting

Determine the string is valid

Dear All, I have a string "1234567899*0#123456789#", it can be divided into: - 1st: 1234567899 Validation: 10 digits, only 0-9 - 2nd: *0# Fixed Value - 3rd: 123456789 Validation: 9 digits, only 0-9 - 4th: # Fixed Value Would like to know if any 1 line statement perl,... (5 Replies)
Discussion started by: jimmy_y
5 Replies

7. Shell Programming and Scripting

A test command parameter is not valid

Hello, Getting error "A test command parameter is not valid" when trying to run the code below under /sbin/sh AA = "12:00" CHK=$(date +"%H:%M") if then print "Yes" fi Getting 2 errors: 1) "AA: not found" 2) "Specify a parameter with this command" Thanks, IS Please... (5 Replies)
Discussion started by: schureki
5 Replies

8. Shell Programming and Scripting

awk command - not a valid identifier message

Trying to run the following awk command : export com.mics.ara.server.tools.sch_reports.Runner.num_threads=`awk -F= '!/^#/ && /com.mics.ara.server.tools.sch_reports.Runner.num_threads/{print $2}' $BKUPDIR/env.properties` -bash: export:... (6 Replies)
Discussion started by: venhart
6 Replies

9. Shell Programming and Scripting

Help regarding Error message: A test command parameter is not valid

Hi I am getting few messages when trying to run my script from the following lines in the script if test then // SomeCode fi The messages are as follows: testing.sh: OBLIGOR_GROUP_ID: 0403-012 A test command parameter is not valid. testing.sh:... (5 Replies)
Discussion started by: skyineyes
5 Replies

10. UNIX for Dummies Questions & Answers

pwd: A specified flag is not valid for this command.

Probably a very straight forward question but please be easy on me, I am v. new to UNIX! A script that I have runs the line tmp=`pwd -H` It works fine, but I needed to make a couple of other changes to the script, nowhere near this line but now this line reports: pwd: A specified flag... (2 Replies)
Discussion started by: Paxton
2 Replies
Login or Register to Ask a Question