2022 Developer Survey is open! Take survey.

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
0 answers
11 views

Confirming the context of bash script

I have a cygwin shell inside windows that loads all kinds of .bashrc scripts on login. These contain organization specific commands. When I execute an external sh file, those organization specific ...
user avatar
0 votes
0 answers
14 views

udev test run oke but script doesn't run

I've been trying to make a rule to run a script when i (dis)connect my qwerty keyboard. This way i can automatically switch to the azerty layout from my laptop. Super+space is a shortcut to switch ...
user avatar
  • 1
0 votes
1 answer
40 views

Is there a way to keep Zenity open after preforming my shell script?

I have made a zenity list that opens up the terminal to run a shell script but after it is ran zenity closes is there a way to keep zenity from closing? Here is my script - #!/bin/bash zret="$( ...
user avatar
  • 1
0 votes
0 answers
27 views

crontab and shellscript

if i have shell script that must do a job 5 times a day in different time according to a specific table, now, i must run for manually each time how i can make it do the job automatically by execute ...
user avatar
  • 19
0 votes
1 answer
38 views

error trying to redirect output of awk script to a new file

I am working on the following code in an awk script and I need the output to be redirected to another file within the same script. What I try to do in the first block is to round the decimals of the ...
user avatar
0 votes
0 answers
15 views

Cant trace sed error

My code is big so i will share the github link here: https://github.com/troopek/TropX Clone it and run the main.sh file with bash, then to recreate the error you will type in 2 and enter in the cli ...
user avatar
0 votes
1 answer
14 views

Delete all lines from a line with certain string until another line with a diffrent string in a file

file.txt: start some text works "HELLO" foo test sum other end start som "other" line with text 'also' thing foo end and I want to delete the line in which "HELLO&...
user avatar
0 votes
1 answer
22 views

Creating folder based on txt file name

I want to ask how could I make a directory based on the text file name For example, I have a text file named Game,Board,Risk.txt What I want to do is to create a folder within the folder like /Game/...
user avatar
  • 1
0 votes
0 answers
12 views

'canberra-gtk-play' is not recognized as an internal or external command

"'canberra-gtk-play' is not recognized as an internal or external command, operable program or batch file". I don't know why this error appears. pls help me fix this bug
user avatar
0 votes
1 answer
31 views

How to create json with file name, size and number of chunks in a directory?

I want to create json holding file name, file size and number of 1000byte chunks each file is divided into eg:I've some txt files, at "/home/anudeep/source" are afile.txt bfile.txt,cfile.txt,...
user avatar
  • 1
0 votes
1 answer
69 views

Shell scripts with table

I want to run a cron job monthly, weekly, daily but in everyday the hours and minutes will be changed as shown in the below table. So, how can I use a "for loop" to do this? The hours and ...
user avatar
  • 19
0 votes
1 answer
18 views

Are there common scripts one can use in its postinst, postrm, etc.?

I'm working on many separate projects each of which comes with a separate Debian package for Ubuntu. For all of the projects including a service, I end up doing similar things in their preinst, ...
user avatar
  • 2,440
1 vote
3 answers
46 views

systemctl not working from shellscript but works from terminal

systemctl stop tomcat_tomcat9.service If I issue the above comand from terminal it is working but if it is executed from shell script I get the below error. Invalid unit name "tomcat_tomcat9....
user avatar
  • 111
0 votes
1 answer
19 views

Getting error while executing PowerShell cmdlet on ubuntu machine

I was currently running PowerShell on ubuntu machine with the help of VS code by importing packages. The commands which I used are: sudo apt update; sudo apt-get install libunwind8; wget https://...
user avatar
  • 1
0 votes
0 answers
13 views

How can I use terminal commands as pattern in grep or any other program? [duplicate]

I've been writing a small script, and one of its functionalities is to register the computer in landscape. To do so, I have to first install landscape and then run this line with the following data: ...
user avatar
0 votes
0 answers
50 views

Rename all files and directories wihtin a directory to uppercase

So, i have a game folder (for example, named: GAME1) which contains 250000+ files and directories. Everything inside needs to be renamed from lowercase to uppercase . I can open a single directory (A) ...
user avatar
0 votes
2 answers
78 views

How to launch multiple Gnome-terminal windows in a shell script and continue only after these have finished

In a script, I want to launch a number of Gnome Terminal windows, and then proceed with the script only when the windows are closed. I have a shell script containing: command 1 gnome-terminal ./...
user avatar
0 votes
0 answers
25 views

Init Script is failing?

I am using a init script for databricks cluster and the below is the script: #!/bin/bash apt-get -y update && apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev This ...
user avatar
  • 1
0 votes
0 answers
30 views

Function in Shell script

I want to apply this function in split like this count=$(find .. -maxdepth 1 -type f|wc -l) N=int($count/32)+1 Split -l $n file.text But it does not work Anyone done it before ?
user avatar
0 votes
0 answers
143 views

Issue with Linux multi user creation using bash script

As per our requirement we provided our devloper group: devs:r-x to /var/log/httpd directory. Now I'm creating a Linux function , which take the developer's first name and create a linux user in our ...
user avatar
0 votes
1 answer
23 views

Linux: How to capture sheduled shutdown datetime and display it on Zenity Window?

Using a script I want to display my system's scheduled shutdown datetime on a Zenity window on the desktop. The following code displays the scheduled date and time formatted. I want to take that date ...
user avatar
  • 197
0 votes
1 answer
21 views

Bash script to automate codec installation

I recently moved from Ubuntu 20.04 to 22.04. I don't keep any media files but when I visited youtube I discovered no audio was playing. After some time I came to (guided)conclusion that I need to ...
user avatar
0 votes
0 answers
33 views

Script to show free memory (Ram) column on `free` command in linux?

I want to write a script that shows available memory in my system every second with the updated value. I have some clues like I can use the free command with the -m option to show in megabytes. I have ...
user avatar
0 votes
0 answers
11 views

Where is the " _10_enable_multidomain_support.py" script?

Working through OpenStack tutorials and in the manage Domains exercise the script "_10_enable_multidomain_support.py"is missing Tutorial has it in /var/snap/microstack/common/etc/horizon....
user avatar
0 votes
1 answer
27 views

Starting a simple sh script at reboot? Why is this to difficult? [duplicate]

I've tried everything, I've followed and undone every method I've come across on here but nothing works. I want to run a simple start-up script for an executable upon reboot, and no other time, as a ...
user avatar
0 votes
1 answer
14 views

How to check if wireless interface is internal or external

I am currently working on a script where i need to check if wireless interface is external or internal. Supoose i have the following output for iwconfig: wlp2s0 unassociated Nickname:"<...
user avatar
  • 31
0 votes
1 answer
101 views

First time writing a script -- why isn't the output going to a file?

I learned to use a computer with DOS so I am trying to approximate a batch/.bat file to run all the updates to my system and create a log file of the outcome. #!/bin/bash #update system in one step cd ...
user avatar
  • 23
0 votes
0 answers
22 views

auto run a script with sudo on specific user after start up

can anyone help me, I'm basically want to run wpa_supplicant -B -i wifiiface1 -c /etc/wpa_supplicant/wpa_supplicant.conf only when logging in with the user "user1", automatically. so I made ...
user avatar
0 votes
2 answers
36 views

What are the differences between shell script and in-shell execution that lead to this different if behavior?

In xfce4-terminal I execute: if [[ $(pgrep -x xfce4-terminal) ]]; then echo "there are files" > test.txt; else echo "no files found" > test.txt; fi ...
user avatar
  • 220
0 votes
1 answer
28 views

Home folder creation for multiple user script

I would need to create a script that daily checks if users have a home folder home/testuser and if not, then create one. The issue is that I would like to exclude built-in accounts from this example: ...
user avatar
0 votes
0 answers
19 views

How can we do that in ubuntu, echo xlsx file content without openning it

Goal: monitors a xlsx file constantly, that xlsx is mounted on a local drive only since it will be updated/edited remotely on a server. Now, I have a python script print out xlsx file content ...
user avatar
0 votes
0 answers
32 views

This output means a security failure?

$ dpkg --verify dpkg: warning: cups-browsed: unable to open /usr/lib/cups/backend/implicitclass for hash: Permission denied ??5?????? /usr/lib/cups/backend/implicitclass ??5?????? c /etc/...
user avatar
0 votes
1 answer
35 views

Executing grub2 command nativedisk before boot (for huge disks)

I moved an Ubuntu 20.04.4 to a 4TB GPT disk, booted bios_grub (i.e. using legacy BIOS). Grub2 allows this, as long as its stage2 code is installed at the start of the disk (like in sectors 34-2047). ...
user avatar
  • 111
0 votes
1 answer
14 views

How to do partial selection during reverse-search

Usually I use Ctr+R to enable reverse-search, and repeat Ctr+R to go through the command history, then tap Tab to select the command. However, something time I may want to do paritial selection, for ...
user avatar
  • 103
0 votes
0 answers
185 views

make: *** No rule to make target 'clean'. Stop. make: *** No targets specified and no makefile found. Stop

I have little experience coding and trying to setup up Python vmaf on Ubuntu using https://github.com/Netflix/vmaf/blob/master/resource/doc/python.md#linux instructions. up to the stage of Clean build ...
user avatar
1 vote
1 answer
122 views

xmodmap doesn't work anymore after upgrading to 22.04

I upgraded to the latest 22.04 LTS version this morning and after that my xmodmap script doesn't work anymore, i'm curious if something has changed that is causing the script to not work anymore. I ...
user avatar
0 votes
3 answers
49 views

How can I edit a command? [duplicate]

I'm trying to edit the clear command. I've tried going into the bin directory then doing: "gedit clear" but it ended in failure because I can't edit the file without potentially corrupting ...
user avatar
0 votes
1 answer
39 views

How to run java command inside bash script in specific directory

So, I host multiple Minecraft servers on my Ubuntu VM and I've setup a script to start all of them at once. The servers are running in screen sessions and basically what the script does is send the ...
user avatar
0 votes
1 answer
15 views

How to run Fn + Esc keyboard combo automatically at startup?

Every time I log in to ubuntu 20.04.4 LTS, my Fn button is toggled to OFF state. So, when I want to change volume, I need to do Fn+Esc and after that I can use my laptop normally. The thing is that ...
user avatar
  • 11
0 votes
0 answers
27 views

How to run consecutive commands in bash script? (Synclient)

I have an executable document about stops and starts touchpad, that includes; #!/bin/bash sudo modprobe -r psmouse; sudo modprobe psmouse; I added ";" between commands so it can run ...
user avatar
  • 31
1 vote
1 answer
43 views

Is the same '#!/usr/bin/env bash' than #!/bin/bash [duplicate]

Simple question, is the same ? Vim autocomplete me when write bash + tab => #!/usr/bin/env bash but I usually watch #!/bin/bash in every script. So..
user avatar
0 votes
1 answer
54 views

How can I pass multiple instructions in one ssh command?

I'm having a problem that I've been stuck on for a while. I did a lot of research and quite a few answers came up but these don't seem to fit in my case. This is what I'm looking to do: Through the ...
user avatar
1 vote
1 answer
27 views

Change password via BASH script using UID

I've created a post-installation automation BASH script for Ubuntu installations. The last thing I want the script to do, is to set the password of UID 1000's password (the user I've created while ...
user avatar
  • 1,380
0 votes
0 answers
35 views

Is there any way of creating a GIF from a square selected space on my screen?

I'd like to create a script that allows me to create a square on my screen and start creating a gif file after the square is made. I think about something like the following: This last gif I've ...
user avatar
  • 371
0 votes
1 answer
73 views

Ubuntu 20.04 startup script does not run at startup

I have a simple script that I set up in Startup Programs but it's never run at startup. I have to run the script manualy instead. # cat ~/.config/autostart/bash.desktop [Desktop Entry] Type=...
user avatar
  • 473
0 votes
0 answers
17 views

usermac and usercaps not found

I'm trying to run a script on Ubuntu 20.04 and I'm getting an error: usermac: command not found usercaps: command not found My script: check_user_db(){ info_log -m -t "user $PGUSER" ...
user avatar
0 votes
2 answers
58 views

Bash script for Logrotate can't start in crontab

i have a simple bash script for execute a logrotate command which is the follow command: sudo logrotate -f /etc/logrotate.d/logfile When i set the bash script into crontab the script didn't execute, ...
user avatar
0 votes
0 answers
29 views

Extract RSSI values using automation scripting for bluetoothctl

I want to extract only RSSI values from the output shown below. [bluetooth]# scan on Discovery started [CHG] Controller 5C:F3:70:62:68:28 Discovering: yes [CHG] Device C8:0F:10:29:4E:75 RSSI: -72 How ...
user avatar
1 vote
0 answers
32 views

What would be the best way to go about installing the same packages every day

At my job i need to install *buntu along with some packages, and do some system configurations everyday. I actually don't mind doing it but can't help this feeling of "If you do it every day you ...
user avatar
0 votes
0 answers
29 views

Unable to setup script for auto-start

I am trying to setup auto connect for bluetooth. I was able to create a script to connect to bluetooth that works when manually executed, however it does not start on startup even after setting it up ...
user avatar

1
2 3 4 5
127