1
vote
0answers
64 views

How to properly start and stop shell script in linux, busybox?

I am trying to write a small shell script that would send some commands to my tv set from my set top box that has busybox on it. The problem is that it generates huge amount of zombie processes, and ...
0
votes
3answers
63 views

How can I add a script to embedded Linux

I have a script (let's say Hello World), that I want to include to my embedded Linux. I'm using Buildroot and want to start the script in Busybox. But because I'm cross-compiling for the target I'm ...
2
votes
0answers
247 views

Number comparisons in BusyBox ash

I have the following script that extracts data from the EXIF command on my BusyBox ash-based system. I parse the date tag from the end of the file and use case as a final check to ensure the format ...
3
votes
1answer
514 views

Need to improve urlencode function

I need a way to URL encode strings with a shell script on a OpenWRT device running old version of busybox. Right now I ended up with the following code: urlencode() { echo "$@" | awk -v ORS="" '{ ...
2
votes
3answers
467 views

Script matching literal pattern over multiple lines?

I have a multi-line string in the variable $PAT. $PAT must be searched for within the file $FILE. If $PAT is in $FILE, it needs to print the file with $PAT removed. If $PAT is not found, then print ...
2
votes
5answers
8k views

Bash iterate over a list of strings

I have this bash script: for opt in string1 string2 string3 ... string99 do somestuff It works, but I would like to replace the explicit listing of my strings with a file which actually contains ...
3
votes
3answers
449 views

How to remove a trailing CRLF from a file?

I have a binary file with a trailing CRLF (2 bytes total) that I want to remove. How should I do it? Please note that I'm using busybox and I don't have perl.