Questions tagged [scripts]
A script is a series of instructions written in a "plain text" file. The script interpreter (for example, Bash or another shell, Python, Perl, Ruby, etc.) reads the file and carries out the instructions as if they had been entered at the command prompt.
5,909
questions
0
votes
1answer
65 views
What does 'pwd' mean? In context of this install script
I have an install command for a particular package contained within a folder
It's a package for encryption and security
Could someone explain for me exactly what 'pwd' might mean?
./install_***.sh `...
0
votes
0answers
16 views
udev rule launches bash script at hotplug but not at coldplug/reboot
basically this udev rule at boot time , but I read somewhere that it was the systemd daemon that handles all the coldplug while udevd handles only the hotplugs.
How to do it with the linux systemd way ...
-1
votes
1answer
50 views
sh -c '…' sh {} not working when using if statement and having ' in the filename
I have the following simplified script:
find /home/cas/plex-media/series/ -type f ! -name "*.srt" -exec sh -c '
file=$1
if [ if-statement using $file ]; then
echo "true&...
0
votes
0answers
23 views
make a script that open two terminal and start projects
I would like to create a script that navigate to 2 project folder, and execute 2 terminal that remain open, so that I don't have to do it everyday.
I tried the following :
#!/bin/bash
cd Repository/...
0
votes
1answer
27 views
What does a "No such file or directory” mean and How do I correct the problem?
I read in Stack Exchange that the message I am getting, "No such file or directory” refers to not being in the directory where the file I need resides. The article suggested using “cd" to ...
1
vote
1answer
14 views
How can I convert netstat output to a variable
netstat -an | grep :443 | grep -v TIME_WAIT | wc -l
How do I convert this retunring value of 171 to a variable foo so that If I enter $foo it will return 171.
2
votes
1answer
24 views
Using xargs and variables
Hey I have a question.
This is the command that I'm using (at the place of echo $file is a different command. I simplified it):
find /home/cas/plex-media/series/ -type f -name "*" ! -name &...
3
votes
1answer
143 views
create directory structure from tree command output
I have few tree command output of some directory structures (in text files). It looks something like:
% cat tree.txt
.
├── grandpartest
│ └── partest
│ └── test
│ ├── empty-asciidoc-...
1
vote
0answers
30 views
Is there any bash script to find the difference of two directories and copy the difference to next third directory?
Actually I need a script that compare the content of two directories and copy the difference to next directory. Suppose I have dir1 which contains file1 and file2; dir2 which contains file1 then the ...
0
votes
0answers
28 views
how to compare timestamp to mach using shellscript?
i am writing a shell-script to trigger mail alert when a package is installed or removed in a server using dpkg.logs
i am using fswatch or inotify to track file modification,i am able to get when the ...
0
votes
0answers
9 views
How to launch anbox.appmgr from crontab in AWS
How can I show notify-send messages triggered by crontab?
I am following this to launch anbox via crontab in the remote server. It works perfect on the local machine, but when I change the content of ...
1
vote
1answer
32 views
Ubuntu 18.04-Replace default screen lock behavior with custom shell script
I'd like to override the default Ubuntu screen locking behavior. I have a shell script set up which does exactly what I want it to do when I run it manually, however, I cannot seem to find any way to ...
2
votes
0answers
20 views
I want to get a warning when apt installing from certain sources, like restricted and multiverse
Is there a way to make apt give a warning whenever I'm about to install a package from certain sources?
For example, suppose I specify main, universe and certain PPAs as "OK" (since they ...
1
vote
1answer
42 views
Scripts that detects kernel activity and reboots when kernel freezes
I'm running a machine that has a GPU running that sometimes causes the machine to freeze. When
I look at syslog file, it says that the kernel is hung:
"echo 0 > /proc/sys/kernel/...
0
votes
0answers
18 views
Thinkorswim raspberry pi installation
Can someone please create a step by step guide on how to install thinkorswim on raspberry pi 4 running ubuntu?
I have read some redit threads and am having difficulties making it work.
This would ...
1
vote
0answers
44 views
Bash script executable manually but only partially via udev rule
I'm on Ubuntu 18.04 LTS and I wrote a script to take pictures and send an email with ssmtp when someone removes a USB device from my computer.
the udev rule works fine and execute the script but only ...
0
votes
0answers
18 views
Released Package With Bug In 'prerm' Script
I have a package that has already been released.
I have a new version of the package that I'd like to release but I've learned that there is a bug in my original 'prerm' script that will cause some ...
1
vote
1answer
26 views
WakeOn-LAN automated script
How would I go about having a desktop shortcut to run a script that sends a WakeOn-LAN packet with the same settings as this graphical online version? I'm using Ubuntu 18.04
https://www.depicus.com/...
0
votes
0answers
20 views
'q-text-as-data: command not found' error in a Bash script?
I am a Linux novice, and I am currently trying to run a Bash Shell Script (see the very bottom) that manipulates files (code snippets) using the Windows 10 Linux Subsystem, but the script keeps ...
0
votes
2answers
48 views
Running a script from the desktop
I wrote a simple script in a text file, put it on the desktop, and made it executable.
When I double-click it (or right-click and "Open" it) from the desktop, nothing happens - it does not ...
1
vote
0answers
44 views
Change folder icons on a usb device
I want to change the folder icons that are on a USB device, so that you get the same look regardless of which machine you open it from.
Is this possible to do through a script that is automatically ...
0
votes
1answer
73 views
/etc/ssh/ssh_config: line 58: Bad configuration option: subsystem [closed]
I have a configured the /etc/ssh/ssh_config file as below -
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users,...
0
votes
0answers
35 views
How to run pynput and FFMPEG script using CRONTAB?
I need to start three python3 scripts and a shell script using crontab. These scripts should run at the same time without any delay. Each script runs exactly for one minute. For instance, I have ...
0
votes
1answer
40 views
How to add a script to /etc/profile.d so the script runs on every login?
I need to make a script that on every login creates folder and subfolder, I have the script written but I don't know how to add it to /etc/profile.d
I have tried to write in /etc/profile.d source /...
0
votes
3answers
181 views
How to execute a script every time the terminal opens?
I have a script with welcome message that I want to execute every time the terminal opens. How can I do that? This is the script, what should I add so the script runs every time I open the terminal?
#!...
1
vote
0answers
29 views
How to create a script that when any user logs on starts a script that creates a workspace?
I need to create a script which, when any Linux Ubuntu user logs on, starts a script that creates a workspace called WORKSPACE_*NAME OF THE USER in the user's home directory, and when logging out, the ...
0
votes
0answers
15 views
Impossible to activate a conda environment by shell script [duplicate]
I would like to activate a conda environment by a shell script, as suggested here, I have tried:
#!/bin/bash -i
source $(conda info --base)/etc/profile.d/conda.sh
conda activate myenv
but it doesn't ...
1
vote
1answer
50 views
why doesnt this bash script get all the files?
I have a large folder with subfolders of pdf files. I want to get all the pdf files (290 of them) and get them into one directory. (I thought that would be simple.) so that I can concatenate them into ...
0
votes
0answers
55 views
How to run a script on startup using Screen on Ubuntu 20.04
Trying to find out how to run this command upon startup of Ubuntu:
su - username -c "screen -dm -S autorunner ~/Desktop/..."
This command is based off of a guide for the Raspbian and uses ...
0
votes
1answer
30 views
How to stop the bash script when a command meets an error?
I need the below bash script to do the following that when the gcc command returns an error, the script will stop looping and exit prematurely. And if the script is exiting prematurely it should ...
0
votes
2answers
69 views
Shell script not running from cron
Server Ubuntu 16.04 running in a Virtual Box.
I had a server which I needed to rebuild (had no backups). I copied all relevant scripts I needed to reuse and all work as expected except one which is ...
0
votes
3answers
93 views
How do I run an .sh file on boot? [duplicate]
I'm using Ubuntu Server 20.04 for Raspberry Pi 4, I'm trying to get a .sh file to run at boot, so I can just plug the Pi in and it runs the script, but how do I do that.
-1
votes
2answers
188 views
How to obtain the latest .deb package of Vivalvi browser?
How to download the latest .deb of Vivaldi browser using wget generic command (with the help of wildcards)? Vivaldi can't be downloaded without entering the exact name and number of the latest build. ...
1
vote
1answer
62 views
Error: Failed to execute child process Failed to execve: No such file or directory
Hello I have the following script, I am learning shell scripting:
#! /bin/sh
gnome-terminal -- 'cd ~/DevSpace/AndroidStudio/arctic_fox/bin/ && ./studio.sh'
After running this I get the ...
0
votes
1answer
53 views
Make these 2 commands run every time my ubuntu starts
I have these 2 commands
echo 0 | sudo tee /sys/module/snd_hda_intel/parameters/power_save_controller
echo 0 | sudo tee /sys/module/snd_hda_intel/parameters/power_save
which are used to remove sound ...
0
votes
0answers
15 views
Script called by inoticoming not always executing correctly
I have a little automation designed to uncompress attachments to certain incoming email and save the decompressed files to a certain directory. Running on Ubuntu 20.4. It is supposed to work as ...
2
votes
1answer
42 views
Automate Curl multiple HTTP requests
On Ubuntu server 16.04.6, I am using Curl (v. 7.47.0) to test my web-server and network components.
Using the -: option (also known as --next), I keep the TCP connection open, and send multiple HTTP ...
0
votes
0answers
14 views
Wsl2 loosing speed / leaking?
I'm running a mapping project on my win10/Wsl2 Ubuntu 20, and the process is a a bash script running imagemagick and analysing colors on maps (500x500px).
The script is also writing reports on the ...
1
vote
3answers
43 views
How do I add a line to the shell script?
I am new to Linux OS. I was trying to add custom colors to my terminal using LS_Colors Project on Github
I installed the package using sh install.sh from the repo.
And it says, To enable the colors, ...
2
votes
1answer
83 views
How to recognise if someone is watching plex media for my bash script
Hey I have a (for me at least) quite difficult question.
I have plex media server installed on my Ubuntu server. I'm writing a script that will automatically check if there's an update for the plex ...
0
votes
0answers
28 views
How can I run two Scripts/Applications at the same time?
I would like to run 2 vban instances at the same time. One for receiving and one for sending audio.
The Scripts work fine but only if I run one at a time. If I try to execute both it does not work.
...
1
vote
0answers
30 views
Set Build in audio Profile to Analog Stereo Output in Pulse Audio Volume Control
Hello i recently installed Ubuntu 20.04.. After installing i found that there is no volume in front headphone . Then i found that if i change "Set Build in audio Profile" to "Analog ...
0
votes
2answers
52 views
Bash command to recognize difference between variables
I am given from stdin 2 variables a name and a number given in any order. How can I identify them correctly in a bash script such that I can print them in a file in the same order(age, Name)
./a.sh ...
0
votes
2answers
55 views
Xubuntu 20.10: “cowsay” script [closed]
Im trying to make a "cowsay" script but i need to know how to do if equal this or that and how to make it accept input (in a sh script file)
2
votes
1answer
173 views
Xubuntu “Bash” doent exist? [duplicate]
Im having a problem with my xubuntu script. This is the script:
#!/bin/bash/
cd /
touch ~/.config/zoomus.conf
cd ~/Desktop
'home/oem/Desktop/Zoom.desktop'
This is my error:
bash: ./zoom.sh: /bin/bash/...
0
votes
0answers
93 views
VPS, Ubuntu 20.04 autostart script
I have few questions about Ubuntu 20.04 and autostarting some script.
I have a VPS and, when the system reboots, I would like the script to automaticaly run. I tried crontab and added:
@reboot user ...
0
votes
0answers
134 views
Run python script return exit code =1 as service Ubuntu
I create a file job_tracking.py
#!/home/thao/venv/bin/python
while True:
print("hello")
# job_tracking_stats()
log_app('Stats tracking Sleeping...')
time.sleep(5)
log_app(...
0
votes
1answer
32 views
How to sort a file before redirecting it as an input to a bash script?
I want to have the second column sorted before using it. It is ok to apply sort-command between braces or is there another method of integrating it into a bash script.
I was thinking of sorting the ...
1
vote
2answers
114 views
Start a script with systemd when user logs in
I'm trying to start a script with systemd, when an user logs in. Nevertheless until now, it is not working the way I'd like.
What I did:
I placed the following service in /etc/systemd/system/...
0
votes
1answer
22 views
How can I create an alias for a file in bash.script and then redirect info to it?
I want my outputFile.txt to be generated in a bash script
I have tried to write it
file='/home/dir1/dir2/dir3/file'
cut -d : -f1 > file
but this doesnt work.
If i write /home/dir1/dir2/dir3/file ...