Skip to content
Advertisement

Tag: shell

Finding an exact match in QNX without using grep -w

I’m writing a script that needs to find an exact match in a file that is compatible with QNX and POSIX compliant Linux more detail: Im trying to find the user of a process so the original command I wrote was which works perfectly in POSIX compliant Linux however, QNX isn’t totally POSIX compliant and grep -w isn’t usable for

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 all other files which are having same pattern and create a new file Remove duplicate header from new file.

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 startup). But when I call stop, the script

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 this is my code: With that code I should

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

Bash: Parse CSV and edit cell values

I am new to bash scripting I have the following CSV Input Expected Output I need to check Location and Way and convert them to UpperCase – ABC, UP Day needs to be mon – Mon I need to do this for entire CSV. I need to correct the value and write all the fields on to CSV or edit

Bash script: cd No such file or directory when file exists

My bash script is written to go to each subfolder in the current directory: When I run my bash script, I am getting a cd error for a directory that exists: Yet, in terminal command line I can do cd ‘Zelkova serrata’ within the same directory as the script and all is fine. Is it possible the bash script has

Advertisement