1

I created a shell script that logs me in to a server. The script was in a directory that was added to $PATH

I think I might have deleted the script when not paying attention (not on purpose). I cannot find the script anymore. I tried several things:

  1. use Spotlight (I'm using a Mac - spotlight does pretty much the same as locate afaik)
  2. use which [scriptname]
  3. go to root and type find * | grep [scriptname]

None of these solutions located the script. HOWEVER: the script is still working. Even after a reboot.

What is going on here? Is the script still somewhere on my drive?

manatwork
  • 31,277
Vincent
  • 2,898
  • It is surely on ur disk. – pradeepchhetri Oct 30 '12 at 18:30
  • 3
    What does type scriptname say? – jw013 Oct 30 '12 at 18:30
  • @pradeepchhetri As jwj013 is hinting, it may not be. Not as a script, that is. – itsbruce Oct 30 '12 at 18:34
  • If the script is running after reboot, then what is starting it? Check the output of crontab -l of your user and root. How does it logon to the server? If ssh then you can find the process with ps and track down the parent process leading to the script and its details such as the path – janos Oct 30 '12 at 18:35

1 Answers1

2

Thanks guys, this is one of those days:

I actually didn't wrote a script... I thought I did. Instead of writing a script, I just put an alias in my .bash_profile.

I remembered when doing the type scriptname as jw013 suggested.

Thanks guys.

Vincent
  • 2,898
  • So that means that the observation that it gets run at boot was wrong? It runs on login? – tink Oct 30 '12 at 19:02