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
Tag: shell
Checking result of executed command in a Bash script
I want to run my VirtualBox after my I logged in. To do that, I have to check if it’s already running or not. If not, then start the VM. My problem is that I can not put the result of VirtualBox command into a variable in Bash. I’ve created a function to get the exit parameter, but I get
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 parse a particular MAC address from DHCP lease file in Openwrt?
I am trying to write a script to parse some of devices from DHCP lease file in Openwrt with corresponding addresses . I am maintain a list with some vendor MAC address . When i connect a device to the router , i want to fetch the IP address ,MAC address and Name of that device using the vendor MAC
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: … …
How to make top run in background ? It needs to run and log the output. Not die or zombie up
I am trying to make a script to log the top output to a file in the background for my embedded system. But as soon as I put it in background, it either exits or zombies up. What is the systems problem with running things in background ? My script I am trying to execute it as and as How
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