i’m trying to move more than one million files from one folder to another using a script but i’m not getting any results i.e no files moved and i did not get any errors,the script checks if they are more than 20 records in a folder and it moves them in another specified folder,here is my script. any suggestion on
Tag: shell
A script wrapper that turns SIGINT into SIGHUP
I use Leiningen REPL that uses SIGINT to interrupt currently running code and to output a new prompt. The REPL can be stopped using SIGHUP or SIGKILL. I don’t actually run anything in the REPL – I just use it for some pre-defined side-effects. The problem is that IntelliJ IDEA can only send SIGINT when it exits to the processes
New to bash scripting – want to have a code block execute many times via reference
I am totally new to bash scripting. I am wondering if there’s a way that I can create a reference for the following code block: Is there a way I can give this block of code a reference point and execute it using the reference several times throughout the rest of the script? Would it be easier/better to create a
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,
Paths must precede expression Linux find
I have the following command: I get the error “find: paths must precede expression: 1990” Why is this? I have quoted the wildcard, so I don’t see the error. How to fix this? Thanks! Answer You need to repeat the -iname argument:
Need help to this bash/shell exercise
The output of this line if expr $x+1 1> /dev/null 2>&1 I really don’t figure out how things go there… Answer Modify your script like this (simple add spaces around the +): expr tries to add 1 to the value of the variable. If the status is 0 (value of $?) it is a number. Otherwise, there is an error,
Script to plot multiple graphs in gnuplot
I try to write a script which will be executed by the shell to use several txt-files in a directory to plot multiple lines in a graph with gnuplot. So if I type in the command for one picture, the results are as imagined. Here you can see the command: Now my Script looks like this: The script edits every
Read first line in a file and append it to first occurrence of the search string and Repeat until EOF
I have a file with following lines in a text file in following format And a json file in following format Now i want output of json as follows So how can achieve this using bash? I’ve tried with following but it only appends last line of the file. Answer This will do it:
Save multiple instances of an image downloaded by wget
What it does is that the url on top is to a camera taking photos every minute. My code downloads that image, saves it and puts it in a html file every 60 seconds. So what I am trying to do is save the newest image in spy.html and the older ones would iteration through the loop until it reaches
How to validate the number of arguments (mandatory and optional) in a shell script?
I am having trouble validating my script arguments. I am trying to achieve 5 mandatory arguments and 2 optional arguments to my script. Here is what I have tried so far. The problem is validating the total number of arguments to this script as I can have a total of 5 or 7 arguments. Providing -a additional -c character is