I have a file that can be bigger than 4GB. I am using the linux split command to split it by lines (that’s the requirement). But after splitting the original file, I want the size of split file to be always less than 2GB. The original file size can vary from 3-5 GB. I want to write some logic for
Tag: shell
find and replace a String in vi editor on linux?
i am trying to replace String with new String in Linux vi editor but getting following error. Answer I’d guess the reason you’re getting that error message is because you intend to replace the string on all lines, not just the current one. In order to search all lines, add a % to your command:
Function Shell Script no return data
When i run the script (./meuscript.sh), I have no return, only if i select cancel the dialog. If I run the script without the function, the command is executed correctly Answer You have an endless loop. Rename the function to something else so that you don’t end up with ping calling ping calling ping calling ping… Additionally, you probably want
I am trying to replace a string in a file via shell script where a part of the string is unknown
I have tried a few ways with sed as below without success: I do not know the value behind “=” which can have up to 2 digits. Before and after the string there is a space, and the string always starts with “device.value=” PS: The file is a one liner with many values seperated through a space. I would appreciate
How to list recently deleted files from a directory?
I’m not even sure if this is easily possible, but I would like to list the files that were recently deleted from a directory, recursively if possible. I’m looking for a solution that does not require the creation of a temporary file containing a snapshot of the original directory structure against which to compare, because write access might not always
Parsing a config file inside shell script
I am trying to parse an ini file inside a shell script. name.conf file: I could parse the values by the command I wanted to know if there was some way by which I could group the contents of my config and parse it name.conf file: I just need the values in a shell array say names and print them
How to compute Cumulative values in Shell?
I would like to compute cumulative values from the below data file and writing them into columns after inserting a serial number. Where ifile.txt has 3 rows and 9 columns in this example. Desire output: Here first column is used for the serial number. So what I did is: I first converted into columns using Then I use awk I
how to create putty shortcut to jump directly to chain ssh? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
Bash script wait depended commands processes
I am fairly new in bash scripting. I need to use bash script for manage my microservices, so these services need build and deploy(on docker). So I have commands like that : So as you see(a little part of script, i am grouping depended commands in functions),commands need to wait previous depended commands like that. But wait $! command doesn’t
Read line output in a shell script
I want to run a program (when executed it produces logdata) out of a shell script and write the output into a text file. I failed to do so :/ $prog is the executed prog -> socat /dev/ttyUSB0,b9600 STDOUT $log/$FILE is just path to a .txt file I had a Perl script to do this: I tried to do this