Questions tagged [scripting]

A script is a sequence of commands or instructions that are executed by an interpreter program rather than compiled into a standalone executable program.

463 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
2answers
132 views

How check flags on systemd?

I try run clickhouse on old CPU, but get error: Illegal instruction Clickhouse required CPU flag SSE 4.2. How check flags on systemd ? Or how write this block on systemd without run bash script? ...
1
vote
0answers
871 views

Automatic Login with cURL without php

I'm working in a little project using a script to do scraping. I'm trying login in https://www.plusdede.com/login, it's a simple login with a numeric captcha. The code which is important is: <div ...
1
vote
1answer
658 views

Why is my udev rule not working?

I need to automatically run my script /var/www/html/configWWW when any USB is plugged in to my Raspberry. UDEV RULE - /etc/udev/rules.d/myRule.rules ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="...
1
vote
1answer
779 views

How to get monitor width using xrandr --query?

I have a shell script, that loops through xrandr to find connected monitors, which get assigned inside of a variable. Inside that loop, I want to have another loop that determines the width of said ...
1
vote
1answer
2k views

bash script for cdo command to run it on different files

I am new in UNIX and I want to apply the CDO (Climate Data Operator) "remapbil" command in order to transform the grid (from a projection to geographical coordinate system). it works perfectly fine ...
1
vote
0answers
626 views

How to speed up awk script that uses several large gzip files?

I have two data files: file_1.in, containing over 2k lines like "12 AB0001": 10 AB0001 11 AC0002 12 AD0003 ... A list of *.gz gzipped files (about 1 to 3 million lines) I should extract and parse ...
1
vote
0answers
276 views

Linux - Ubuntu - GUI - Remote Mouse and Keyboard from 1 master to 10 slaves

Is it possible to replicate mouse and keyboard actions to multiple devices? e.g. listen on ubuntu 1, then replicate the exact mouse and keyboard actions to ubuntu 2, ubuntu 3, ubuntu 4 and so on. I ...
1
vote
3answers
261 views

How to rsync content from another machine through multiple machines?

I have 4 linux machines having name A,B,C,D and I want to rsync some content from machine A machine D, but A is not directly connected to D and but A is connected to B and B is connected to C and C is ...
1
vote
0answers
40 views

Opening applications in a different desktop from a command line

Is there a bash command which can open a particular application in a different desktop (virtual desktops) in KDE Plasma 5.8.7? I'm trying to make a script file which when I run will make my entire ...
1
vote
0answers
111 views

Run multiple screens and attach them for a split view

So I'm new to screen and I've been using this .screenrc for now - https://gitlab.com/joaopizani/env.screenrc-ftw. I'm trying to make a script that, given a target host, will do the following: Open a ...
1
vote
1answer
160 views

pass the value of variable from a script to another script from another server

I have a script that will ssh to another server. Script A will get the value of $variableA, then will ssh to another server to execute a script B which will need the value of $variableA. I tried ...
1
vote
1answer
398 views

Run a script immediately after login before /etc/motd is read

How can I run a script immediately after login before /etc/motd is read? I' m not looking to run the script from within /etc/profile.d or ~/.bashrc or ~/.profile
1
vote
1answer
380 views

Shell Script to read output of command

I'm doing a script to monitor some things from websites and one of the things is to monitor the http status and their response time. In the script I run a command to get the http_status: (http ...
1
vote
1answer
1k views

How to automatically detect and write to usb with variable spaces in its name

I am doing the second BASH exercise from TLDP Bash-Scripting Guide, and I have most of it figured out up until the part when it comes time to copy the compressed files to an inserted USB. Home ...
1
vote
0answers
141 views

Script to rename workspace

I'm using Linux Mint Mate and I want to have a script to do set-workspace-name 0 "Workspace 1" How would it be? I tried this but it doesn't work since there is no ~/.workspacenames/names directory. ...
1
vote
0answers
32 views

Read input with startup script Finnix 110

I am in the process of setting up a liveUSB that will run some scripts on a machine when it is booted. The main OS on the USB is finnix 110, and I am setting up startup scripts in the /indep/rc ...
1
vote
0answers
144 views

How to automate downloading recent file uploaded in Google Drive folder?

I want to automate the downloading of files that are daily uploaded to a shared Google Drive folder.
1
vote
2answers
70 views

Replacing number with the same value (number) of one characters

I have to find all file types using file -b $(find . -type f), sort them into unique categories, and print out top 4 most categories where the number is replaced with equal number of "#". The output ...
1
vote
1answer
1k views

Save cached video on firefox?

I found a script on the internet that allows me to save cached flash files. https://github.com/janosgyerik/shellscripts/blob/master/bash/save-flash-linux.sh This would allow me to run the command ...
1
vote
1answer
197 views

vimdiff - Custom file name possible while we export?

I am comparing 2 files in a script and exporting to html file (Below is the syntax i am using). When the file get saved, its saving in a name called Diff.html by default. Is there a way we can save it ...
1
vote
1answer
42 views

Running script on fedora cloud image at boot

I need a little help from you on a project i'm working on with the Fedora Cloud image. Since it's a cloud image, during boot, it sends out HTTP request to locate the meta-data service. After ...
1
vote
1answer
613 views

Lines per second script

I have about 800 log files and I'm trying to write a script that reports the counts of lines per second or "requests per second" in each log file and reports the output which includes the timestamp ...
1
vote
1answer
109 views

Generalising Grid Engine qsub job file for multiple programs and input file names

I am using Grid Engine on a Linux cluster. I am running many jobs with different programs and different input files. I don't want to create multiple specific job scripts for each pair of program and ...
1
vote
0answers
587 views

`Unhandled Exception: System.ArgumentNullException: Value cannot be null.` error while running `dotnet run` using a startup script

I'm trying to run a dotnet app using dotnet run --configuration Release at system server Startup/Reboot. I'm using a init.d script to acheive the same. My startup script, located at /etc/init.d/...
1
vote
1answer
186 views

Unix Solaris script for executing commands in multiple remote hosts

I have two hosts for eg. 1) 00.00.00.01 having regions on diffrent ports for eg. a) a1region (port 0011) b) b1region (port 0012) c) c1region (port 0013) 2) 00.00.00.02 having regions on diffrent ...
1
vote
0answers
1k views

Ansible, trying to find a way to force a task time out on a host it's currently operating on

Concerning Ansible, this should be fairly straightforwards I hope: Scenario: I have 3 servers, red, green, and blue. I have a task created for ansible to use yum in linux to install a random ...
1
vote
0answers
74 views

Setting up working environment - Konsole or other terminal - open few tabs and run some commands

I have a working environment where I run a web server, TSC compiler, and then work in few directories in a console, and also run few programs - IDE, 2x gitk, krusader. I would like to be able to ...
1
vote
0answers
61 views

Identify (and delete) all .gif files with more than 1 frame in all subdirectories

I having the following linux command to identify all .gif files and list its frames in the active directory: identify -format '%n %i\n' -- *.gif Now I want to modify and expand the command to ...
1
vote
0answers
433 views

Debian/Raspberry usb webcam test before issuing fswebcam script, multiple fails will crash OS

I was able to configure raspberry Pi as wifi_router/firewall/gammu/weewex/ups/webcam weather server. The problem which I'm not able to solve is incompatibility issue between linux and Microsoft ...
1
vote
0answers
313 views

SSH login e-mail alert using pam_exec.so

I have been trying to use pam_exec.so module to send e-mails whenever someones logs in using ssh but it gives exit code 8 and code is not executed. I tried to use the suggested solution in here SSH ...
1
vote
0answers
334 views

Creating master process and connecting slave processes

Google-fu failed me on this issue as I have no idea what are the correct keywords and this is my first time encountering such an issue. I am using Linux Mint and I am trying to run a program called ...
1
vote
1answer
82 views

How to programmatically query the Freedesktop application database?

I know about xdg-mime which can query the mapping from MIME filetype to associated desktop application. But this can return mappings to non-existent applications, e.g. $ xdg-mime default non-...
1
vote
0answers
4k views

Pacemaker - Corosync - HA - Simple Custom Resource Testing - Status flapping - Started - Failed - Stopped - Started

I am testing using the OCF:Heartbeat:Dummy script and I want to make a very basic setup just to know it works and build on that. The only information I can find was this web blog here. https://...
1
vote
0answers
368 views

Task Automation With .EXE program and Bash Script?

There's a Windows program called Visipics. It finds similar images, not merely duplicates. I find it superior to findimagedupes (I use it with Manjaro and Linux Mint) and competing Windows programs, ...
1
vote
1answer
1k views

`Interact` not working as expected in bash/expect scripting

In order to provision an embedded device (i.e. writing images to flash) a series of very well known commands have to be entered during the boot stage. The algorithm is something like: Capture a ...
1
vote
0answers
56 views

ImageMagick + ruTorrent-stats (Github repo)

I am trying to combine information I found here on the Unix & Linux Stack with I Wim Leers' rutorrent-stats I have some experience with coding simple websites and while I am by no means a ...
1
vote
0answers
613 views

Automatically set Light and Dark Themes to interchange at Given times

I have a specific setting for my light theme and darker theme to use at night.How can I automate the interchange process.?
1
vote
1answer
111 views

Summarize certain data fields of apache CLF log file

I want to grep some information from raw combined log format apache logs: 51.254.56.62 - - [01/Jun/2016:20:49:28 +0500] "GET /vendors/jquery.slimscroll.min.js HTTP/1.1" 404 - "http://networkconfig....
1
vote
1answer
316 views

detecting sound from speakers

I have decided to make a radio from my old laptop. I installed Puppy linux and set special features, like: after waking up, it turns on my favorite online radio (openFM) and switches off the screen. ...
1
vote
0answers
96 views

Systemd and controlling network settings

I'm trying to figure out best way to control network settings in best way possible in real time. My current plan is this: Start ip -s -d -o monitor with systemd and write its output to file ...
1
vote
2answers
213 views

Bash script fail to detect disk

I got a script that is supposed to reformat and mount /dev/disk/by-label/backup_disk into /mnt/backup_disk. Like this: /sbin/mkfs.ext4 -q -L backup_disk /dev/disk/by-label/backup_disk mount -t ext4 /...
1
vote
0answers
78 views

Linux Mint Corners Musical Sequence Associative Array

I am writing a script which uses hot corners to play specific musical notes when hovering in corners, and depending on the musical sequence to execute a specific command. The script is called with ...
1
vote
2answers
603 views

Command to merge all terminal windows?

Is there a terminal command that merges all open terminal windows into one window with tabs? Been searching all over the place, but have yet to find any solutions.
1
vote
1answer
258 views

alsa config for startup

I'm having a problem with my headphone. A friendly person over at the #alsa irc channel came up with this to rectify: sudo hda-verb /dev/snd/hwC0D0 0x15 SET_EAPD_BTLENABLE 2 However it has to be ...
1
vote
1answer
590 views

Setting environment variable using shell script

I am using csh scripts for some automation purpose. I have a number of scripts, and the beginning of all of which I need to set a fixed set of environment variables. |----SCRIPT 1---| |----SCRIPT ...
1
vote
1answer
37 views

Evenly allocate resources over multiple desinations

I'm not quite familiar enough with bash to figure this out properly, I'll try to be brief with what I'm trying to figure out! I have many paths stored in a file, along with their size (in G), such ...
1
vote
1answer
918 views

How to put the percentage of use of each core from cpu

I use the Zabbix Server to monitor my environment. The metrics used by Zabbix to view the CPU are too confusing, so I would like to simplify. Is there a way to get the percentage of use of each core ...
1
vote
1answer
864 views

how to make scripts that shows Western Zodiac?

I want to make scripts that shows Western Zodiac which accepts as input a person's birthday on the command line and prints out the following: The day of the week on which the person was born Their ...
1
vote
1answer
625 views

Get IP Address of Main Interface in Ubuntu and Mac

I need to write a script that gets the IP address of the interface that is used for unknown routes (e.g. where 0.0.0.0/0 is routed through) That script should work on Ubuntu, Debian, Arch and Mac OS ...
1
vote
3answers
43 views

how to edit a bilingual text by scripting?

I have a column of words in which English words are glued to Chinese words like this: abominate******** abhor************* (The stars represent the Chinese alphabet) I want to write a ...