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…
Tag: bash
Syntax error when trying to pipe multiple commands in an alias definition
Hey can anyone help me to solve syntax error on creation of alias.I am new to bash so i am not aware of any restriction in use of alias command Every time i run this alias command I get this error. Answer Avoid using alias (they’re only allowed in interactive shells) and define a simple function instead…
How do you make a Concourse Linux Machine read executable files? (chmod style)
I am trying to get my Concourse CI Linux VM to run a shell script. But i keep getting the same error: I fixed this locally (non VM, on a Mac) with chmod +x path/filename.sh to make it executable and adding !#/bin/sh to the shell script. But i dont know how to get Concourse/VM to know that it’s an execut…
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
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 …
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 …