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.

Filter by
Sorted by
Tagged with
0
votes
1answer
42 views

How to create bash command base on idle time to turn off external monitor?

Ubuntu 18.04 64bit Desktop with Nvidia dedicated Card GPU. Brightness reset issue had been happening without knowing the solution when I set power saving to blank screen on an external monitor to turn ...
1
vote
0answers
22 views

Ubuntu 18.04, Scripts not starting at boot

I have two scripts that need to run at start up. Both are Python scripts and have a sleep 60; command to allow the OS to fully boot before they start running. What's odd is I have an identical machine ...
6
votes
2answers
291 views

Creating script to cp directory multiple times

I have a directory called DeepSight-Instance1. I am trying to copy it 4 times so I also have DeepSight-Instance2, DeepSight-Instance3, DeepSight-Instance4 and DeepSight-Instance5. I am able to use the ...
1
vote
1answer
36 views

Script to access all the existing homes

I'm new to bash scripting and I'm trying to create a script which goes trough all the userhomes for several machines to delete entries from the authorized_keys. Deleting the entries is easy, but to ...
0
votes
0answers
26 views

How to change themes

How to change themes on Cinnamon terminal (bash) idk i have look for a .config file i can not find it if you can help it will be cool (Ubuntu 20)
0
votes
1answer
52 views

Command Execution With Arguments Have No Relation with Stdin?

Here is a script to check what the source is for stdin, which is from How-to Geek: "What Are stdin, stdout, and stderr on Linux?" https://www.howtogeek.com/435903/what-are-stdin-stdout-and-...
3
votes
2answers
894 views

How to hide text input in terminal

I'm writing a script in Bash that prompts the user for a password and I need the typed text to not show, as when you enter an ssh password. Does anyone have the solution for this?
0
votes
0answers
28 views

Login and password on script

I need your help to creat a script for my company , the script must execute a bin script by a command line, once it launches the command the service asks for a login and a password, after this step ...
1
vote
2answers
103 views

How do I show stdout while executing bash script using Desktop Entry? [closed]

I'm using Ubuntu 20.04 LTS x86-64 with kernel Linux 5.4.0-42-generic. I have tried every solution for using a desktop launcher to execute a bash script. If I set the default program to an editor then ...
0
votes
0answers
19 views

Long mysqldump process with cron not finishing

I have a large database to backup with cron and mysqldump. It is over 50 GB and getting bigger. I noticed in the last few days it is not working properly. When I run the script from terminal it works, ...
1
vote
1answer
64 views

How to run python script after I close terminal? [duplicate]

Sorry for the lame question, I faced VDS for the first time in my life. I've set everything up, installed all python modules the app needed and after I run my script like python test.py it works just ...
1
vote
0answers
35 views

Cannot launch Python3 Script using .desktop file in Ubuntu 20.04

I am a beginner in both Python and Ubuntu. I was trying to launch a python script to display Tkinter GUI using Ubuntu .desktop file. But it won't run instead it shows the file in editor. Below are my ...
0
votes
1answer
31 views

bash script for finding missing files which have variable gaps

I have folders with several PNG files like pic_191120081.png pic_191120241.png . . . pic_192722801.png pic_192722961.png so when c5-c8 remain the same, c9-c12 increase of 16. But after a number of ...
1
vote
0answers
35 views

Jupyter Note book and Desktop Short cut

I have the following problem. I have a .ipynb in a specific folder called ~/mho of course that I have to divulge I have an anaconda installation. My questions is how can I start up Jupyter from a ...
0
votes
0answers
34 views

Sudo script does not run at startup (tried every possibility) [closed]

Using Lubuntu 18.10 I tried every possible way to run startup scripts but without success. I just want to run this command at startup, which starts a web server at 127.0.0.1:80 $ sudo ~/bin/kiwix/...
-1
votes
0answers
28 views

How to pass multiple arguments with sudo command

I am running a bash script and it will pop up one dialog for yes and no, so I don't want user interaction... I just want to pass for as many pop ups come in between echo mypassword | sudo -S ...
1
vote
1answer
53 views

Creating separate scripts to run after separate reboots

I am wanting to run multiple scripts after boot up. When the machine boots up, one script would run and force a reboot. Then, after the reboot, another script would run and then reboot. Need this ...
1
vote
0answers
16 views

How to Launch anbox.appmgr via crontab [duplicate]

I'm able to launch anbox.appmgr from a SSH session using: DISPLAY=:0 /snap/bin/anbox.appmgr. I'm also able to launch anbox.appmgr from a sh script: #!/bin/bash if ! pidof org.anbox.appmgr >/dev/...
0
votes
1answer
17 views

Automated Driver Loading: Cron, Init, or Modprobe

Main Problem I am attempting to automate the loading of drivers for my system. The drivers were built manually and must be loaded manually. Another caveat is that one of the system drivers must be ...
-3
votes
1answer
56 views

Parsing file with recurring box of text and adding an element when it is not present

fruits : this is from germany, netherlands, france apple: ripe fruit orange: c vitamin banana: d vitamin fruits : this is from poland, austria orange: c vitamin pineapple: a vitamin,help in digestion:...
0
votes
0answers
32 views

if condition to check for yum or apt [migrated]

I try to achieve writing a Bash script for automated setup of a Linux box. Depending on installed OS, Ubuntu or CentOS, I want to run different stuff. But somehow that if condition does not seem to ...
0
votes
1answer
91 views

Using dbus-send in Cron

I want to setup a cron job to lock my session every day at three PM. When I enter dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock in a ...
-1
votes
0answers
24 views

Log User Process or Command Terminal Execution StartTime and EndTime

We need to create a service to log User Process or Command Terminal Execution StartTime and EndTime along with username (Excluding the system level process). Sometime, the user maybe super user, so we ...
1
vote
2answers
127 views

How to restore file names that were renamed by a script

I just switched to using Ubuntu full time (coming from Windows 10), and I’ve read that it’s not a good idea to have spaces in file names on Linux. So I found a script online (see below) to replace ...
-1
votes
0answers
60 views

How can I download part of a video with ffmpeg? [closed]

I can't get this right. Must be a problem with double quotes #!/bin/bash var=$(xclip -o) if [ -z $var ]; then echo 'copia url a descargar al portapapeles' fi printf "(1) download part ...
0
votes
0answers
15 views

Script to convert multiple mp4s to mp3s

I have a lot of mp4s I need to convert to mp3s. I need some help with a bash script for the job. This works on single files. #!/bin/bash # # Converts mp4s to mp3s # Uses avconv # Ex. mp4tomp3.sh '...
1
vote
0answers
105 views

How can I get my joystick name, in a shell/bash context?

When running from a terminal I type: jstest /dev/input/js1 | grep '^Joystick' and get the name. But the jstest cmd is interactive, and needs a Ctrl+c to finish. How can I get such result into a shell ...
0
votes
1answer
91 views

Crontab + random wallpaper issue

I am trying to set up crontab to run a script that will pick a random image from a folder and set it as my wallpaper in the morning, and another script that will do the same thing at night. Goal is to ...
0
votes
1answer
20 views

Have backup script not run if image is restored

I have a bash script that backs up impt files such as documents, icons, etc. to a second drive. It runs every time my computer is booted. But every once in a blue moon, I have to restore a Redo image. ...
0
votes
0answers
27 views

“aws: command not found” when used in a script invoked by a Snap

I would like to take screenshots and have them uploaded to my S3 bucket. I tried to use both ksnip and ScreenCloud (installed as snaps), and I have a similar problem with both. I configure them to run ...
0
votes
1answer
55 views

Cannot execute screenfetch

I have downloaded screenfetch in one directory I make. mkdir ~/screenfetch wget -O screenfetch 'https://raw.github.com/KittyKatt/screenFetch/master/screenfetch-dev' chmod +x screenfetch ./screenfetch ...
1
vote
1answer
34 views

Writing a script file using arrays [duplicate]

Hello I'm testing my self by using a tutorial on writing linux shell scripts ran into this issue usinng shell arrays. the syntax is being written using vi name[0]=chuck name[1]=samson echo "...
1
vote
1answer
73 views

Mount does not work only in shell script, loop device [closed]

I have a script that includes the line: sudo mount -o loop ./ubuntu.iso ./mount In interactive shell (bash), this works totally fine. If I run the script, the command fails with: mount: ./mount: ...
0
votes
1answer
57 views

iwatch can't cp?

I am creating a tool that is supposed to get data from a CD-ROM upon inserting. This is supposed to be headless, so I wanted to use iwatch to monitor for changes in the /media/ folder. So far it ...
1
vote
2answers
138 views

“0: command not found” error while running a bash script

This is my script: echo "please enter any number" read n a= $(($n % 2)) if [ $a -eq 0 ]; then echo "EVEN" else echo "ODD" fi This is the script's output: $ ...
0
votes
1answer
75 views

Do I need to call Python in a cron job script?

I'm trying to run a cron job from a home server that runs Ubuntu 24/7, using a Python script to clear a remote mailbox. In a folder "scripts" in my home folder, I've put in a Python script, ...
1
vote
1answer
63 views

How do I get values of certain row by column names?

This is the output for the command aws iam get-credential-report --query 'Content' --output text | base64 -d from this output how to grep the values of access_key_1_active and ...
-1
votes
2answers
71 views

Execute a bash file by double clicking

Instead of following the steps at https://www.xp-pen.com/faq-56-210.html, I want to be able to double click the bash file and run the software. I followed the steps in https://www.youtube.com/watch?v=...
0
votes
0answers
31 views

Remove files automatically when MAC address changes

Can anyone help me to make batch to auto delete specific files in Linux once a MAC address changed by the user?
2
votes
1answer
97 views

Batch FFmpeg encoding - Variable CRF based on Bitrate

I use ffmpeg in a VM instance running Ubuntu to encode some videos I downloaded from various streaming sites to HEVC. Currently I use a bash script to convert all these files in a directory. Overall ...
-1
votes
0answers
88 views

How can I easily run a port forwarding command at startup (before login)?

I know there are 100,000 answers to this, but I have no idea which one is current. Looking for the most simple and easy solution to run a script. I'm running an application that controls some lights. ...
0
votes
1answer
23 views

Pause Dropbox after sync

Is is possible to automatically pause dropbox after sync? I am thinking, every time I start my computer, dropbox is also starting. But, is it possible to get Dropbox to pause or close directly after ...
0
votes
1answer
78 views

How to write an init script that will execute an existing start script in Ubuntu 20.04?

my question similar to: How to write an init script that will execute an existing start script? However, that question is outdated and I like to know how I can do that in Ubuntu 20.04 This my try in ...
0
votes
0answers
24 views

Automatically Delete Specific Log File at Reboot.(ubuntu 16.04)

I have Ubuntu server 16.04, and I have configured tracker software in server. While rebooting the server this tracker delete old log file and create new log(log file extension is same but name will be ...
-1
votes
0answers
53 views

Script run using systemd service before shutdown take too long and doesn't finish [migrated]

I have successfully create a service in systemd that run a script just before server shutdown/reboot. But the problem is that my script take too long to execute (around 3-4 minutes) and the server ...
0
votes
1answer
19 views

script file command not found

I have a simple script file first.sh as shown below: #!/bin/bash echo "hello"; a = "test"; echo "$a" when I execute it, it occurs an error as written below: ./first.sh: ...
0
votes
0answers
47 views

Exit from all nested shell script

How to exit from all nested shell script calls once in a single command?
1
vote
0answers
20 views

How do I code switches with the dash in bash shell scripts?

So I'm writing a bash shell script for launching dockers to control whether they are interactive or persistent after instantiating, and give them a name. In the command line I will include the ...
0
votes
0answers
37 views

python versions in /usr/bin/<python> confusion when running cronjobs

I am trying to launch python scripts as cronjobs on ubuntu18.04. The command works fine when running it in terminal as suggested by many posts: /usr/bin/python3.7 /home/jc/scripts/my_Script.py >>...
5
votes
1answer
298 views

Learning terminal by observing commands being run by GUI [duplicate]

Hello I'm new to the Linux system and would like to know if there is a code or application which opens a terminal that will tell me the lines of code being used. For example, If I were to open a ...

1
2 3 4 5
115