- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: sourcing script help
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
Discussions
Discussions
Forums
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
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
тАО09-14-2007 04:17 AM
тАО09-14-2007 04:17 AM
I am facing one problem with the sourcing script. I don't know in past it used to run. I am facing a problem wherein it is not able to set the path for cleartool.exe
We have following command to find the path of cleartool.exe
CLEARTOOL=`type cleartool | sed -e 's%\\\\%/%g' -e 's/.* //' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
But on my system the output is
files/rational/clearcase/bin/cleartool.exe: not found
Instead of
C:\Program Files\Rational\ClearCase\bin\
Can anybody give me the idea how to fix it.
Regards
Padma
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 05:03 AM
тАО09-14-2007 05:03 AM
Re: sourcing script help
What are the contents of the "cleartool" file you are sending to sed? The sed statement is going to replace any double \\s with a single /, and remove any text up to and including the first space.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 05:11 AM
тАО09-14-2007 05:11 AM
Re: sourcing script help
Oh, I see you aren't using the windows type command, but the shell builtin.
I'm not sure what you are doing in that case...taking the path to your current cleartool executable and reformatting it for what? What does "type cleartool" give you? What does "echo $CLEARTOOL" give you after running the command? What do you want it to give you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 05:15 AM
тАО09-14-2007 05:15 AM
Re: sourcing script help
Thanks for the response. When I run
type cleartool it give following output
cleartool is C:/Program Files/Rational/ClearCase/bin/cleartool.exe
but when it pipes it with sed as below within the script then it gives the following output
`type cleartool | sed -e 's%\\\\%/%g' -e 's/.* //' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
files/rational/clearcase/bin/cleartool.exe: not found
It should set the path to cleartool as
C:/Program Files/Rational/ClearCase/bin/cleartool.exe
Regards
PAdma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 05:19 AM
тАО09-14-2007 05:19 AM
Re: sourcing script help
CLEARTOOL=`type cleartool`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2007 10:11 AM
тАО09-14-2007 10:11 AM
SolutionIf you have Unix, you can use dirname(1):
$ CLEARTOOL=$(dirname "$(type cleartool)")
Your above sed and tr commands are useless. You don't want to downshift. You don't want to delete everything before the first space. Nor do you want to change \\ to /.
Using this sed may help:
sed -e 's/\(.*\\\).*$/\1/'
It should remove everything after the last "\".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2007 11:40 PM
тАО09-16-2007 11:40 PM
Re: sourcing script help
one hint is the space in the pathname, but the major problem is: you are on windows :-)
Not knowing, which UNIX-tools are available, I think, you should have 'tr' as well, when a 'sed' is in sight.
On a MKS-ksh-Shell this starts the cleartool command for me:
$ ct=`whence cleartool | tr '\\' /`
$ print $ct
C:/Program Files/Rational/Clearcase/bin/cleartool.EXE
$ "$ct"
mfG Peter
mfG Peter