Skip to content
Advertisement

Tag: scripting

Bash script that prints statistics about text files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 4 years ago. Improve this question I am trying to write a Linux bash script that will

How to simplify the comparison in the bash?

how to make several comparisons in the bash by placing the condition and comparison points next to instead of the long queue ? that something like this before : after (what I want): Answer Try this using bash regex with the keywork =~: Edit : As seen in comments, for real you need to compare int, not strings, so :

having an issue with my bash script

im writing a script that allows the user to create a backup of a file they choose by allowing them to input the file name. the file will then have backup followed by being date stamped at the end of it’s name and saved on the home drive. but whenever i try to run it i get an error: cp:

Looping a bash script

this is my first time dabbling in bash scripting and first time using this site. I’m working on script that’s meant to provide the user with a list of software packages to install and then output their choices into a 2nd script file that can be run later to actually install their choices. So far my script is semi working,

empty an existing array in ksh

I have script which stores the list of files in an array as shown below I have to empty this my_array variable to use it for other purpose. I cannot declare another new array. Is there any way to clear the content of the array and reuse it again? Thanks in advance. Answer Since you’re already using set -A …

Set docker image username at container creation time?

I have an OpenSuse 42.3 docker image that I’ve configured to run a code. The image has a single user(other than root) called “myuser” that I create during the initial Image generation via the Dockerfile. I have three script files that generate a container from the image based on what operating system a user is on. Question: Can the username

How to run iterations asynchronously in shell script

I have a few .csv files like below. xyz0900@1#-1637746436.csv xxx0900@1#-1637746436.csv zzz0900@2#-1637746439.csv yyy0900@1#-1637746436.csv sss0900@2#-1637746439.csv I have written a script to perform below tasks: Get the large file based on the pattern which we have passed as a argument to the script. Merge all other files which are having same pattern and create a new file Remove duplicate header from new file.

Advertisement