Skip to main content
edited tags
Link
muru
  • 209.4k
  • 58
  • 520
  • 794
replaced http://askubuntu.com/ with https://askubuntu.com/
Source Link

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal.

For example, I make a shell script named 1, make it executable with chmod +x 1 and put it in /usr/local/bin, and inside the script I type #!/bin/sh on the first line, and then my commands. From there on, it's very conveniently usable and quick to execute by typing

1 Enter

on the terminal, from inside any folder.

My problem is that I'm currently working on a computer where can't do sudo and I can't expect to get it either, so I can't place my script in /usr/local/bin.

What are my options? Is there another path with the same "run from anywhere" capability, which I can access without sudo, or another way to achieve something equivalent?

The accepted answer to this postthis post says

For user-scoped scripts, use bin/ in your home directory.

Which I tried, but there is no bin folder in my home directory, and when I created one, I still could not run the script from anywhere else.

I'm running on Ubuntu 12.04 LTS.

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal.

For example, I make a shell script named 1, make it executable with chmod +x 1 and put it in /usr/local/bin, and inside the script I type #!/bin/sh on the first line, and then my commands. From there on, it's very conveniently usable and quick to execute by typing

1 Enter

on the terminal, from inside any folder.

My problem is that I'm currently working on a computer where can't do sudo and I can't expect to get it either, so I can't place my script in /usr/local/bin.

What are my options? Is there another path with the same "run from anywhere" capability, which I can access without sudo, or another way to achieve something equivalent?

The accepted answer to this post says

For user-scoped scripts, use bin/ in your home directory.

Which I tried, but there is no bin folder in my home directory, and when I created one, I still could not run the script from anywhere else.

I'm running on Ubuntu 12.04 LTS.

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal.

For example, I make a shell script named 1, make it executable with chmod +x 1 and put it in /usr/local/bin, and inside the script I type #!/bin/sh on the first line, and then my commands. From there on, it's very conveniently usable and quick to execute by typing

1 Enter

on the terminal, from inside any folder.

My problem is that I'm currently working on a computer where can't do sudo and I can't expect to get it either, so I can't place my script in /usr/local/bin.

What are my options? Is there another path with the same "run from anywhere" capability, which I can access without sudo, or another way to achieve something equivalent?

The accepted answer to this post says

For user-scoped scripts, use bin/ in your home directory.

Which I tried, but there is no bin folder in my home directory, and when I created one, I still could not run the script from anywhere else.

I'm running on Ubuntu 12.04 LTS.

Tweeted twitter.com/#!/AskUbuntu/status/616185704457084928
added 10 characters in body
Source Link
Maythux
  • 87.9k
  • 58
  • 247
  • 283

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal.

For example, I make a shell script named 1, make it executable with chmod +x 1 and put it in /usr/local/bin, and inside the script I type #!/bin/sh on the first line, and then my commands. From there on, it's very conveniently usable and quick to execute by typing

1 <Enter>Enter

on the terminal, from inside any folder.

My problem is that I'm currently working on a computer where can't do sudo and I can't expect to get it either, so I can't place my script in /usr/local/bin.

What are my options? Is there another path with the same "run from anywhere" capability, which I can access without sudo, or another way to achieve something equivalent?

The accepted answer to this post says

For user-scoped scripts, use bin/ in your home directory.

Which I tried, but there is no bin folder in my home directory, and when I created one, I still could not run the script from anywhere else.

I'm running on Ubuntu 12.04 LTS.

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal.

For example, I make a shell script named 1, make it executable with chmod +x 1 and put it in /usr/local/bin, and inside the script I type #!/bin/sh on the first line, and then my commands. From there on, it's very conveniently usable and quick to execute by typing

1 <Enter>

on the terminal, from inside any folder.

My problem is that I'm currently working on a computer where can't do sudo and I can't expect to get it either, so I can't place my script in /usr/local/bin.

What are my options? Is there another path with the same "run from anywhere" capability, which I can access without sudo, or another way to achieve something equivalent?

The accepted answer to this post says

For user-scoped scripts, use bin/ in your home directory.

Which I tried, but there is no bin folder in my home directory, and when I created one, I still could not run the script from anywhere else.

I'm running on Ubuntu 12.04 LTS.

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal.

For example, I make a shell script named 1, make it executable with chmod +x 1 and put it in /usr/local/bin, and inside the script I type #!/bin/sh on the first line, and then my commands. From there on, it's very conveniently usable and quick to execute by typing

1 Enter

on the terminal, from inside any folder.

My problem is that I'm currently working on a computer where can't do sudo and I can't expect to get it either, so I can't place my script in /usr/local/bin.

What are my options? Is there another path with the same "run from anywhere" capability, which I can access without sudo, or another way to achieve something equivalent?

The accepted answer to this post says

For user-scoped scripts, use bin/ in your home directory.

Which I tried, but there is no bin folder in my home directory, and when I created one, I still could not run the script from anywhere else.

I'm running on Ubuntu 12.04 LTS.

Source Link
user985366
  • 474
  • 1
  • 7
  • 11
Loading