Author Topic: Operating System Commands to Change File System Context Within SlickEdit  (Read 6328 times)

keibrewe

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Hi,

I'm trying to find a way to call operation system commands while working in SlickEdit. I've tried the "OS Commands" option on the Project setup, but didn't get the expected results.

The goal is to call something like the ClearCase "cleartool setview" command to setup a dynamic view to be added into my workspace.

For example, I'm able to see my VOBs from the "Add Tree" command if I call "cleartool setview ..." prior to starting SlickEdit.

I'd like to be able to do this from within the context of SlickEdit, however, so that I'm not tied to a single view while I work.

I'm currently using version 15.0.1.3 in Linux.

Thanks,
Keil

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Operating System Commands to Change File System Context Within SlickEdit
« Reply #1 on: November 16, 2010, 08:26:50 PM »
See the "command line" topic in the help.  Don't know about Linux but on Windows you can enter an OS command on the slick command line.  Press escape to bring up the command line and type your command in.  Or you can write a macro and use the shell command.  (I don't know what a "VOB" is though).

Graeme

keibrewe

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Operating System Commands to Change File System Context Within SlickEdit
« Reply #2 on: November 16, 2010, 10:53:01 PM »
Hi Graeme,

Thanks for the response.

I've tried using the command line. I can do basic commands like "ls" and "cd." However, I cannot use the command I need in this case.

Let me try to explain in more detail.

Prior to opening SlickEdit, I do not set into a specific ClearCase view. So if I attempt to list the directory where my source is stored, nothing will appear.

$ls /vob/vob_name/
$

Now, if I use the following command prior to starting SlickEdit, then the source tree will be available under the /vob/vob_name/ path.
$cleartool setview my_view
$ls /vob/vob_name/
src/
obj/
$

If I open a new terminal and attempt to list the files under /vob/vob_name/, then again, I will see nothing because I haven't run the setview command yet.

$ls /vob/vob_name/
$

Now if I start SlickEdit from the terminal where I ran the setview command, I can see the src/ and obj/ directories when I attempt to add a source tree to my Project.

The thing is, I'd like to be able to call the "cleartool setview" command from within SlickEdit, so that I can change the context of that /vob/ directory without closing SlickEdit and running the setview command again.

Thanks!
Keil

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Operating System Commands to Change File System Context Within SlickEdit
« Reply #3 on: November 17, 2010, 12:15:30 AM »
So is the problem that the cleartool command applies only to the shell in which it is executed and not to the whole machine?  If you use the cleartool command on the slick cmd line, does it actually open a shell window, execute then close again?

Maybe you could try running the cleartool command from the slickedit build window.
Probably someone who uses Linux or clearcase could help you better than me.

Graeme

keibrewe

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Operating System Commands to Change File System Context Within SlickEdit
« Reply #4 on: November 17, 2010, 09:09:08 PM »
Thanks for giving this a shot, Graeme.

I tried the cleartool setview command in the build window. I end up losing my shell prompt once I do this though. I get it back once I hit ctrl-c. It's a similar result if you were to type "bash" or "csh" at the prompt in the build window.

Have you ever seen someone try to open a new shell instance from within the build window? That might be able to get me going in the right direction.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Operating System Commands to Change File System Context Within SlickEdit
« Reply #5 on: November 18, 2010, 12:23:48 AM »
Unfortunately I have only a vague understanding of what's going on here.  I think you'll get more help on a ClearCase forum as this is probably not a SlickEdit specific issue.

I think what happens in Windows (but I'm not sure) is that when SlickEdit starts, it inherits a copy of whatever shell environment it's started from.  Exactly what the "environment" consists of apart from environment variables I don't really know.  If you start a new shell from within slickedit and then create a new environment variable in that shell, slickedit doesn't get to see that new environment variable.  If you create a new environment variable in the build window, then close the build window, the new environment variable is thrown away too.  In slickedit macro code you can call a function set_env to change an environment variable that persists as long as slickedit is running.  If you change an environment variable in the build window, I don't know whether that gets seen by the slickedit get_env function or not.

If you don't get any help here a ClearCase forum is probably your best bet.

Graeme

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: Operating System Commands to Change File System Context Within SlickEdit
« Reply #6 on: November 18, 2010, 03:17:19 PM »
Hi,

I'm trying to find a way to call operation system commands while working in SlickEdit. I've tried the "OS Commands" option on the Project setup, but didn't get the expected results.

The goal is to call something like the ClearCase "cleartool setview" command to setup a dynamic view to be added into my workspace.

For example, I'm able to see my VOBs from the "Add Tree" command if I call "cleartool setview ..." prior to starting SlickEdit.

I'd like to be able to do this from within the context of SlickEdit, however, so that I'm not tied to a single view while I work.

I'm currently using version 15.0.1.3 in Linux.

Thanks,
Keil

This is just a SWAG, but shouldn't this be done in the context of VCS?  I'm not running any at the moment, but I just walked through the menus, and ClearCase is supported, but this command isn't listed.  However, there is an Add button for Commands.