Skip to content

Tag: bash

egrep two identical numbers and two identical letters n times

Hi I’ve been having trouble with the command egrep. Here is my question: Lets just say I was running in a for loop on these words: I only want to print the word if it has two identical numbers and two identical letters and the word repeats itself. for example in this case the only words that should prin…

moving files between folders not working

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. a…

How can i add linux bash script file into terraform code?

My requirement is I need to create 3 aws instances using terraform and run a 3 different bash scripts in it. All files are on same server. I already have terraform code to create an infrastructure and 3 bash script ready to use. this is my terraform code to create an AWS instance But i am not sure how i

Linux Bash script isnt printing out correctly

GOAL: My goal in this assignment is to create a script that will take in a student id as an input and will output a matching student’s name OR an error message saying there is none by that name in this class. Im fairly new to Linux and it is kinda tough for me but I would love all the

Finding repeated names in a file

Hi i have a txt file with last name and name of people, now i want do use egrep to only display the names of the people with the same last name. I have no idea how i could do this. Thanks for help my txt looks like this: and the output should be: I’ve currently tried running: …but this

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 m…

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 …