Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
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 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.