I am a beginner and my work starts to become difficult for me. I explain my problem. I have two tables File1 and File2 (reference table). I don’t have any identical column but I have some similarity between &2File1 and &2File2. File1 is from user and we want to standardize everything so I have a lot o…
Tag: bash
Replace white spaces with underscores within a file (bash)
I am currently writing a script that accesses another file using “mapfile” to put it into an array. However, the inputted file contains some white spaces, which the script reads as a new array entry. How do I replace the white spaces with underscores within the body of the file I’m bringing …
Cannot Connect to Linux Oracle Databse with Perl Script after connecting with PuTTY
I have the following problem: I currently connect to one of our Linux servers using PuTTY on my Windows 10 machine. If I use a ‘standard’ PuTTY connection I have no problem: I can log in and run my Perl script to access an Oracle database on the Linux server. However, recently I have set up a new PuTTY connec…
Iterate Variables of array into command which itself is a variable bash
I am almost there, the “$i” is where I am having trouble. I have tried ${i}, “$i”, $i. I am sure someone with more experience can help me here I have been working on this for 1 full day. Driving me nuts. Answer That $i is expanded at the moment you define the sts array. After that, it …
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 …
How to stop a shell script correctly?
I’ve written a small bash script to start a program every 3 seconds. This script is executed on startup and it saves its PID into a pidfile: The problem is, I can’t terminate the shell script by calling start_gps-read.sh stop. There it should read the pidfile and stop the inital process (from star…
Command works in terminal but not as alias in profile.d
I have a problem regarding an alias file in /etc/profile.d/. This isn’t anything important. I’m just interested why it isn’t working as expected. So basically I have the file 00-alias.sh at the path mentioned above and I wanted to make a shortcut which reads a specific line of a file. So thi…
How to grep two IP addresses and increase the value of the last number?
I’m pretty new to Linux and writing scripts etc. I have this task where I need to find an IP-address from a database and then grep a bunch of files with this IP and the next one to see, if they have any presence there. Currently I have to first write: and then And I have to manually change the
Spliting large scm files into individual commands
I have a very large scm file that is over 3 million lines long. I am ‘cat’ing it through a telnet port to a virtual server. I need to split the code into its individual lines and feed it into the server. It should send one line and wait a few milliseconds before sending the next line. Ex: … …
How can I delete a specific text in a text file
I have a text file : and I want to delete 192.168.47.1 line I tried but output is : I tried sed ‘s/192.168.47.1//g’ but again output is : I searched on google but but I am not able to find the right one. Answer The problem is that your pattern matches 3 lines in your data. You need to end