All Questions
22
questions
0
votes
2
answers
81
views
Adding simple shortcut on the terminal, the right way
I am trying to add folder to PATH variable (for specific user only).
so to ~/.bashrc i have added
export PATH=$PATH:/home/username/Tools/scripts/
within this folder i am having scripts and some ...
0
votes
1
answer
540
views
How do I use sudo on a script I made myself that is already in my path and executable?
How do I make a script that I made myself that I already put in my path and made executable usable with sudo? (Xubuntu 22.04.1.)
The script is located here: ~/bin/myScript.
When, from an arbitrary ...
0
votes
2
answers
283
views
Keyboard shortcuts don't see my custom executable
On Ubuntu 22.04 I have an executable (bash) file in custom folder scripts in the home. The path of the latter is properly included at the end of the .bashrc file (and also at the end of the .profile ...
4
votes
1
answer
5k
views
How to run scripts that are in PATH?
I'm pretty much completely new to Ubuntu, so bear with me.
I have made a few scrips without the .sh extension and granted them permission with chmod 755, and the scripts run just fine as long as I'm ...
1
vote
1
answer
2k
views
Pass/set `current directory` to/for a shell script from Java in Ubuntu 16.04
While trying to automate an installation process in Ubuntu 16.04 with a .jar file, I did not know how to solve the following problem:
Problem description
Part of the installation files automatically ...
0
votes
1
answer
1k
views
How to set, permanently, my own directory instead of /home/bin in $PATH in ubuntu? [duplicate]
This might be a repeated question, but I couldn't relate to any previous answer. I basically want to run my shell-script from anywhere in ubuntu 16.04 (whether I'm inside the directory where the shell-...
4
votes
1
answer
32k
views
Adding folders to your PATH environment variable
Currently running Ubuntu 18.04 LTS. I'm trying to install Ndless
and the SDK that goes with it so I can write programs in C and run them on my calculator. Anyways, I was wondering if somebody could ...
4
votes
2
answers
5k
views
How to get the real path of a sh file that is being sourced
I added this line into my ~/.bashrc
. /mnt/c/Users/enzo/drive/projects/dotfiles/init.sh
And and inside of init.sh I am trying to get the path of init.sh but I am not able to.
I tried this so far:
...
2
votes
1
answer
6k
views
opencv python fails to load image
I am following this tutorial
The suggested code is:
import numpy as np
import cv2
# Load an color image in grayscale
img = cv2.imread('messi5.jpg',0)
cv2.imshow('image',img)
cv2.waitKey(0)
...
30
votes
4
answers
90k
views
When writing a bash script, how do I get the absolute path of the location of the current file?
Suppose I have a bash file called myBash.bash. It resides in:
/myDirect/myFolder/myBash.bash
Now I want to use the string /myDirect/myFolder (the location of myBash.bash) inside the script. Is ...
7
votes
2
answers
600
views
Having a list of paths, how can I filter out subdirectories of previously mentioned paths?
Let's say I have a sorted list of absolute paths, like the one in my answer here (shortened and modified for this question):
/proc
/proc/sys/fs/binfmt_misc
/proc/sys/fs/binfmt_misc
/run
/run/...
3
votes
1
answer
2k
views
Create txt with full paths to files and some additional text
I have a bunch of files, in many folders and I wanted to create txt file with full paths to this files and with space and name of the directory they are in. something like:
halva/foo/bar/1/something....
0
votes
1
answer
759
views
.sh and .php file not working on crontab - updated
I am using Cloud9 Server. I have an .sh file that works fine when I open it on terminal, however, when I add a crontab task in crontab -e to open this file, it does not work well.
My .sh file ...
1
vote
2
answers
376
views
How do I modify paths and change to a real path?
I am a beginner at Ubuntu. I am wanting to install my-udev-notify, and I was able to follow these instructions in the README.md file:
Installation
------------
- unpack archive somewhere ...
2
votes
3
answers
3k
views
How can I create a command with arguments and a configuration file? [closed]
Directly to the point, I want to give the user the flexibility to pass arguments to a command in order to control how the commands should run, something like:
pcap -d 30 -w 2
In other words:
I want ...
1
vote
1
answer
77
views
how to fix filenames with dash or space
I created a bash file, but when I run it to those files (or folders) which they have "space" or "-", my command doesn’t work! how to fix this problem.
#!/bin/bash
dpi=$(zenity --entry --text "...
3
votes
2
answers
216
views
How to stock all files with the same suffix into a table?
i'm making a little shell script and i want to stock all files with same suffix in a table.
i want something like that :
path=/home/user/Documents
suffix="_suffix.txt"
and then a function that ...
2
votes
2
answers
1k
views
installing a script in $PATH
I am trying to use yeoman in Ubuntu. Everything is installed correctly but I can't use the command yo from bash. If I navigate to the appropriate directory and run node cli.js everything works from ...
0
votes
2
answers
271
views
How to make a script which always activates on the startup? [duplicate]
So I'd like to add always a folder to the Path. I'm not a huge linux wizard but I think I would need to always write the "export PATH=$PATH:(directory)" line when I log in. But I need this to be on ...
0
votes
2
answers
1k
views
How to add your Eclipse workspace folder to your PATH?
I am using Ubuntu 12.04.
Hi I have been working on the following issue for a couple of days and as much as a I look at the many different answers (What is PATH environment variable and how to add it) ...
0
votes
2
answers
52
views
problem: running scripts from remote dir
the problem I have is the following, I recently installed Ubuntu and was setting up a map where I could collect all my scripts. The map I use is the bin folder on the location:
/home/myusername/bin
...
16
votes
3
answers
96k
views
Launch shell scripts from anywhere [duplicate]
Is it possible to run my scripts located in ~/scripts from anywhere?
Say i want to run ./scriptname regardless of my current working directory.