Skip to main content

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.

0 votes
4 answers
81 views

I would like to mount a partition of an external hard drive from a script using udisksctl mount --block-device /dev/sda1 and in the end of the script I would like to unmount it. However, it may ...
Alexey's user avatar
  • 2,380
10 votes
7 answers
1k views

I am writing a script that locates a special type of file on my system and I want to check if those files are also present on a remote machine. So to test a single file I use: ssh -T user@host [[ -f /...
Nunkuat's user avatar
  • 203
0 votes
7 answers
2k views

Bash allows to export read-only variables and functions to the environment. Also, when a bash script is run, Bash sources the file BASH_ENV was set to, unless invoked with -p. How do you protect ...
anick's user avatar
  • 611
3 votes
7 answers
1k views

In Linux in a folder, without subfolders, there are many files like this scheme. I list them with ls -1. 1yBWVnZCx8CoPrGIG.part01.rar 1yBWVnZCx8CoPrGIG.part02.rar 1yBWVnZCx8CoPrGIG.part03.rar ...
Banana's user avatar
  • 241
5 votes
1 answer
332 views

This may seem like a question asked, but I have yet to find anything that works and I start suspecting it may be a bug in apt-get… So, I have a python installer wrapping around apt-get, whose relevant ...
Hi-Angel's user avatar
  • 5,600
1 vote
1 answer
40 views

I'm trying to compile the drm-subtree of JSM because I want to enable the panfrost driver on the RockPro64 / KHADAS EDGE-V / RK3399. The code is here: https://github.com/jsm222/drm-subtree He improved ...
john_connor's user avatar
3 votes
4 answers
148 views

#!/usr/bin/env bash exec {BASH_XTRACEFD}>./xtrace.log declare -p BASH_XTRACEFD set -x { : "how do you hide this in ./xtrace.log?"; } 2>/dev/null # fail # { :; } "${BASH_XTRACEFD:-...
anick's user avatar
  • 611
656 votes
24 answers
751k views

There's a built-in Unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For ...
dreeves's user avatar
  • 6,709
0 votes
5 answers
214 views

In Linux in a directory there are files, ls -1 shows me this output : file1.1-rvr file1.2-rvr file1.3 file1.4-rvr file1.5 file1.6-rvr file2.1 file2.2 file3.1 file3.10 file3.2-rvr file3.3-rvr file3.4 ...
Banana's user avatar
  • 241
660 votes
4 answers
508k views

I have been looking at a few scripts other people wrote (specifically Red Hat), and a lot of their variables are assigned using the following notation VARIABLE1="${VARIABLE1:-some_val}" or some expand ...
Justin Garrison's user avatar
1 vote
1 answer
102 views

In Linux there are some Folders. I want to process each of this Folders with the program myprogramm. I get a list with ls -1 or much better, sure only Folders with: find . -maxdepth 1 -type d -printf '...
Banana's user avatar
  • 241
1 vote
1 answer
42 views

made a simple command to change my power mode to "balanced-performance" (lenovolegion power mode for custom mode), works fine in terminal and running the file, but when listing it as a ...
bomby's user avatar
  • 11
0 votes
3 answers
616 views

I have a third-party service. Its API and credentials let me scrape service data on my local Linux machine. I want to use this API inside a bash script and launch it via cron, but I don't want to ...
Aleksey's user avatar
  • 75
4 votes
2 answers
693 views

I'm trying to find the "right" way to read files line-by-line. I have been using for for line in $(cat "$FILE"); do for a while, and I really enjoy its clearness. I know that while ...
atis's user avatar
  • 43
39 votes
6 answers
188k views

I have two similar scripts with different names. One works fine but other throws error. Can anyone please tell me what is the issue? This is my test.sh scripts which works fine [nnice@myhost Scripts]$ ...
Nitin Kumar's user avatar

15 30 50 per page
1
2 3 4 5
305