All Questions
26 questions
0
votes
1
answer
380
views
Script to find x265 files then output name
I'm trying to make a script that crawls through a giving directory and list all files that are x265. Using mediainfo and can see if the file is x264 or x265, I then use sed to clean up the text. The ...
0
votes
1
answer
1k
views
awk command inside bash shell script loop
I have a bash script which is supposed to go through a series of files text file. I have written a for loop to do this job automatically for me but I am not getting any output files when the script ...
0
votes
1
answer
124
views
setting number of integers for unlimited argumments
I'm not quite sure what I'm doing here but I need to be able to get an unlimited number of integers to be provided as arguments
so far I have
for sum in $@; do
sum=$(($1 + $2 + $3))
done
echo ...
0
votes
1
answer
88
views
tar command in for loop starts from the wrong number
backup/ has the following files.
ubuntu@ip-172-31-8-46:~/$ ls backup/
itrpl_dsm_10_1.tif itrpl_dsm_12_3.tif itrpl_dsm_2_3.tif itrpl_dsm_4_3.tif itrpl_dsm_6_3.tif itrpl_dsm_8_3.tif
itrpl_dsm_10_2....
0
votes
1
answer
2k
views
finding the highest character length in each column using a loop and awk
I am trying to create a script that goes through a document and finds the highest character length in a column and return it. This script returns 78,78,78,78 when, what im aiming for is 10,11,14,51
...
0
votes
1
answer
1k
views
Bash script that runs parallel threads slows down substantially over several hours
I have a script I came up that simply executes another process into the background that attempts to control the max number of processes running (300 in this case).
It initially executes scripts at ...
1
vote
3
answers
1k
views
How to ignore file in a for loop
I'm making a script to start up a number of services at server reboot. To do this, I'm looping over the directory, checking that each has a start.sh script, and calling that script if they do. ...
2
votes
1
answer
1k
views
Changing a file with values from another file - Bash script
I am trying to write a script that takes two files as arguments and changes an .svg file with values from a .csv file. Csv file consists of lines with two values; id,colour. I need to find the id in ...
2
votes
3
answers
6k
views
Progress bar to display progress based on number of files found/completed in for loop?
Is there a progress bar that can show visually completed progress based on the number of detected files found and completed in a for loop like the one below?
mkdir -p hflip; for i in *.mp4; do ffmpeg ...
0
votes
1
answer
41
views
Bash script to link networked account directories to local account directories
I'm working on a script that will create a local user account, and link local account directories to networked account directories. The only directories I would like to be created and linked are the ...
-1
votes
1
answer
321
views
Why does this for loop ignore my variable? [duplicate]
I am trying to do a simple script which runs a few commands N number of times, determined by the user's input. However, when it comes to run the commands (in a for loop) - The variable is ignored:
...
2
votes
1
answer
188
views
How can I sum the time based on usernames?
Basically, I want to see how much time every user spent logged in.
(username) pts/0 (IP adress) Tue Dec 12 17:51 - 18:14 (00:22) - this is how one line looks in the last command. The ...
0
votes
2
answers
565
views
Reverse-exchange file names of files in a folder from bottom up
I have a some jpg files in a certain folder:
hg_test_spr.jpg
hg_test00001.jpg
hg_test00002.jpg
hg_test00003.jpg
hg_test00004.jpg
hg_test00005.jpg
hg_test00006.jpg
.
.
.
hg_test01200.jpg
I want to ...
1
vote
2
answers
4k
views
Go to the beginning of the loop in bash
I am using an if condition inside a for loop. If the if condition returns yes, then I'd like to go to the start of the for loop again. Is this possible in bash?
#!/bin/bash
for i in /apps/incoming/*....
0
votes
4
answers
1k
views
How to repeatedly alternate between two (or more) commands?
I'd like to repeatedly iterate over, alternate between, and/or cycle through multiple commands; in a kind of pattern or loop. The desired end result could be thought of as not totally unlike watch.
I'...