Skip to main content

All Questions

1 vote
1 answer
154 views

Shell script to run command and show output in notification box

I have command line utility that generates text strings, by running a command within the directory: ./Utility -P it prints output on terminal. How to make a shell script showing the generated string ...
minto's user avatar
  • 553
12 votes
2 answers
5k views

Check if current user can run sudo without requiring a password

I want to check if the current user running a BASH shell script has access to passwordless sudo or not. If they don't, I'd rather have the script exit rather than prompting them for a password.
Jay Taylor's user avatar
-1 votes
1 answer
44 views

How to modify the output of $PATH in Linux [closed]

How can I modify the output of $PATH from $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin to $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/...
Shahriar Flamneco's user avatar
-1 votes
1 answer
260 views

What are some common uses for `run-parts`? [closed]

run-parts executes all programs and scripts in a directory -- but when do I need it? What are some common uses for it?
PetaspeedBeaver's user avatar
4 votes
2 answers
905 views

Combine two files as part of a command line parameter

I am trying to use csvgrep (part of csvkit) to extract rows matching one of two files. Unfortunately, there is no command line option that allows two matching files (like grep does). Only, csvgrep -f ...
Robert Altman's user avatar
3 votes
3 answers
908 views

Alternatives to file polling?

In the following code, I have to poll $tmp_input to continue executing the code because wezterm cli send-text is asynchronous. This makes sure that $tmp_input is ready. tmp_input=$(mktemp ./tmp_input....
wyc's user avatar
  • 143
0 votes
0 answers
44 views

sed not reading directory information [duplicate]

I'm having problems with sed. I can't seem to get this to work. I have a data file (renegade.dat), which contains the following lines: /opt/rg/data/ /opt/rg/misc/ /opt/rg/menu/ /opt/rg/logs/ /opt/rg/...
ignatius's user avatar
  • 411
0 votes
2 answers
205 views

Command-line tool enabling tagging and related tags functionality

Is there a command-line tool that enables to give a file more attributes than a name? For example, we have a file called ubuntu.pdf and we give it tags like command-line, shell, nautilus, ...
xralf's user avatar
  • 15k
0 votes
0 answers
206 views

Write output of multiple python scripts to single file

I used to have only one Python script, the output of which would be directed to a log file. It works like this: I have it in autostart, using crontab @reboot /bin/sleep 30; sudo /usr/bin/python3 -u /...
Dahlin's user avatar
  • 1
1 vote
2 answers
5k views

How to run the command "sudo sh /path/to/script.sh" by double clicking?

I have a question from this thread How to run a bash script by double clicking by entering the path in sudoers?. Since it was explained to me that it is unsafe to grant sudo privileges to the script....
moninah's user avatar
  • 15
0 votes
0 answers
95 views

How to avoid restarting a long running and slow starting python program when executed from a shell script?

I use Whisper to transcribe sound files. On my hardware it takes several minutes, if not dozens of minutes just to start it (it needs to load and process several GBs of data every time it is launched)....
d-b's user avatar
  • 2,047
0 votes
3 answers
141 views

Gain access to selective subdirectories inside main directory

I am looking for a way to gain access to only certain subdirectories inside the main directory in z/OS UNIX. Is there any way to accomplish this? Currently the main directory permissions are set to ...
Brindha Sharadha's user avatar
0 votes
1 answer
217 views

Atrun command in macos is not starting

I'm learning the 'at' command in macOS. However, my 'at' command jobs are getting scheduled but never executing. For example, when I run a simple command like echo "hello world" | at 9:30 AM,...
Mathew Nelson's user avatar
1 vote
2 answers
439 views

Pinning a file to that it appears in the beginning in a folder

I am using Ubuntu (Linux mint). There is a mouse option, if I right-click on a file, I can then choose to pin a file (inside its folder), so that whatever file arranging method (alphabetical, by-date, ...
mahbubweb's user avatar
  • 141
0 votes
2 answers
363 views

missing argument to `-exec' error when executing Shell script but runs fine on command lines

I have this Shell script here: ### # Create a folder dynamically mkdir archived_PA_"$(date -d "6 months ago - 1 day" +%Y-%m-%d)"_"$(date -d "1 day ago" +%Y-%m-%d)&...
Anna Nguyen's user avatar

15 30 50 per page
1
2 3 4 5
28