Dear experts i have a small problem where i just want to reverse the columns.For example i have a data sets arranged in 4 columns i need to put last column first, and so on reversely…how can this work be done…i hope some expert will definitely answer my questions.Thanks in put data example i need output like as below Answer
Tag: shell
Redirect parallel process bash script output to individual log file
I have a requirement, where i need to pass multiple arguments to the script to trigger parallel process for each argument. Now i need to capture each process output in the separate log file. Above piece of code can only give parallel processing for the input arguments. I tried with exec > >(tee “/path/of/log/$arg_filedate +%Y%m%d%H.log”) 2>&1 and it was able
Trying to rename files using two txt files but not getting the right results
recently just tried to write a script so I could rename multiple files from two txt files in correct order, it kinda works but not getting the results I’m looking for. If anyone can see what’s wrong with this please let me know! Answer Assuming that both files have exactly the same number of lines (each line representing a filename),
shell script that runs program that takes two input files
I want to develop a shell script that calls a program that requires two input files. The question is that, it is not only one pair that has to process it, but x number of pairs that are in the same directory. In the directory I have for example: The command line of the program is as follows: And what
How to reproduce “Too Many open files” error in Shell
Assume that my open file limit is 1024 per process, Then how to reproduce Too Many open file error in shell script? I tried above, but it opens 10 files in 10 different processes. Answer You can use ulimit -n to set the maximum number of open files to a low number, and then open up more than that number
How do I tell awk not to make any changes to an empty row
I have a dataset with three columns that look like this: I want to subtract a certain number from each entry in the second column and I know how to do that. But with how the data looks, I end up getting an output that looks like this: How do I prevent awk from adding that extra “-0.1” in the
Find all files above a size and truncate?
Running cPanel on a server with various customer accounts under the /home directory. Many customers’ error_log files are exceeding a desired size (let’s say 100MB) and I want to create a cron job to run daily to truncate any files over a certain size. I know truncate can shrink files but it will extend files if they’re smaller than the
making a Hotel management system in BashScript
I am unable to correct the error. I have tried searching on Google but i can’t figure out what my output is referring to. Its giving a line number but the code is right there. “fi” is used at the end of IF statements in scriptfiles. This is my code I am attaching the output too Error while running the
How to list files recursively with complete path, size, last accessed date and last modified date?
It can be using find, ls or stat Expected output: Answer You can try this : Size is in K-bytes
why “mpv $(ls video *)” is not the same as “mpv video *”? (pls help noobie to work with shell)
So, the problem is – I have a list of files and I want to send them into a program, so it could handle this list in the same process. What I mean is, for example I have a bunch video files, that I want to play with mpv, but I need to pass them into a certain order which