- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /usr/bin/which[7]:Syntax error at line 7: "(" is n...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 06:15 PM
12-09-2001 06:15 PM
/usr/bin/which[7]:Syntax error at line 7: "(" is not expected
#/usr/bin/which lp
--> above error messg
#ll /usr/bin/which
r-xr-xr-x 1 bin bin 661 Nov 7 1997 /usr/bin/which
Any suggestions to resolve above error?
Have tried:
* copy /usr/bin/which from another working system, same problem
* "diff" /usr/bin/which with another working system's, NO Difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 06:41 PM
12-09-2001 06:41 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
#/usr/bin/which lp
/usr/bin/lp
#cksum /usr/bin/which
1271578485 661 /usr/bin/which
#cksum /usr/bin/lp
3622737874 49152 /usr/bin/lp
Does checksum output is same as mine ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 06:51 PM
12-09-2001 06:51 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
* "cksum /usr/bin/which" produces the SAME cksum as yours :--
1271578485 661 /usr/bin/which
NOTE:
* Don't think there is anything wrong with the /usr/bin/which script --> read my "NOTE" in my 1st post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 08:26 PM
12-09-2001 08:26 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
# type which
(type is an alias for whence -v, a much more useful command than which or whereis)
If: type which produces: "which is /usr/bin/which"
then try this:
# /usr/bin/which lp
If that works OK, then the previous command probably did not return: /usr/bin/which
The point is that the shell NOT run the command you expect unless $PATH and aliases are standard. type (and whence) will tell you exactly what the shell will run, something that which and whereis will not. Try:
# whereis history
# which history
# whence -v history
Once you know that /usr/bin/which is the command that is being run, the next is to see if something in the environment is overriding the shell interpreter line:
#! /usr/bin/csh
If this line is missing, then the current shell will be used to interpret the script. Thus, if you are running POSIX shell or ksh and the interpreter line is missing, you'll get the error listed in your subject line.
Perhaps someone has replaced /usr/bin/csh with /usr/bin/sh or /usr/bin/ksh? (some sysadmins would say this would be an improvement--I would never say that..)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 09:52 PM
12-09-2001 09:52 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
* You have nearly got it correct.
* I found that /usr/bin/csh has been overwritten.
* I ftp /usr/bin/csh from another working system, "cksum /usr/bin/csh" to compare. No difference.
* However, now the error mess has changed :
#type which (which is /usr/bin/which)
#/usr/bin/which lp
/usr/local/Cshrc: No such file or directory
#whereis history (history: )
#which history
/usr/local/Cshrc: No such file or directory
#whence -v history
history is an exported alias for fc -l
Any ideas, Bill ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 09:54 PM
12-09-2001 09:54 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 09:58 PM
12-09-2001 09:58 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2001 10:15 PM
12-09-2001 10:15 PM
Re: /usr/bin/which[7]:Syntax error at line 7: "(" is not expected
1) /usr/bin/csh has been overwritten
--> I have copied from another working system.
2) root's $HOME/.cshrc contains "source /usr/local/Cshrc".
After deleting root's $HOME/.cshrc, everything is now FINE.
The problem is now SOLVED.
Thank you everybody for your assistance, esp Bill who pointed me in the right direction.