Questions tagged [ash]

A shell(ash) written by Kenneth Almquist and released to the comp.sources.unix Usenet news group on May 30th 1989. It has features similar to the Bourne shell(sh). Its many derivatives include the system shell on; Debian (dash), FreeBSD (sh), NetBSD (sh) and the default shell in Busybox (ash).

189 questions
-1
votes
1 answer

Linux compiled binary getting wrong exit code if Ctrl+C entered from a shell script launched by the binary

I've got what I think is a strange one here. I have the following environment. A Linux compiled binary which sets up a signal handler to disable things like Ctrl+C, Ctrl+z, etc. This is done by calling signal on: SIGINT, SITTSTP and SIGQUIT. The…
-1
votes
1 answer

Retrieve variable (or state file) from remote host using telnet?

I have wifi module as client that connected to my router (linux based firmware, Openwrt). And sometime, i need to retrieve GPIO state from wifi module. It can be done simply by connect in to usb serial and type print (gpio.read(1)) It will return…
-1
votes
1 answer

How to mix integer and string compare in shell script?

I have a vendor supplied too that emits this result: 40u (0xd926) 48u (0xd92e) 56u (0xd936) 64u (0xd93e) 104u (0xd966) 112u (0xd96e) 136u (0xd986) 144u (0xd98e) 153u (0xd997) 161u (0xd99f) 36l (0xd826) 44l (0xd82e) 52l (0xd836) 60l (0xd83e) 100l…
Wes Miller
  • 2,191
  • 2
  • 38
  • 64
-1
votes
1 answer

Catch word after specific word in a string with -ash

get_channel() { local wifidev="$1" set -- $( iw dev "$wifidev" info ) # e.g. 'Interface wlan0 ifindex 6 wdev 0x2 addr 10:6f:3f:0e:31:8e type IBSS wiphy 0 channel 11 (2462 MHz) NO HT' case "$@" in *" channel "*) …
Bastian Bittorf
  • 447
  • 4
  • 6
-2
votes
1 answer

Extract column from file with shell

I would like to extract column number 8 from the following table using shell (ash): 0xd024 2 0 32 20 3 0 1 0 2 1384 1692 -61 27694088 0xd028 0 1 5 11 1 0 …
Anis_Stack
  • 3,306
  • 4
  • 30
  • 53
-2
votes
3 answers

How to extract indexes from strings?

My file contains data as indicated below: { "any1", "aaa.bbb.ccc.1.ddd", "var1" } { "any2", "aaa.bbb.ccc.1.eee", "toto" } { "an42", "aaa.bbb.ccc.1.fff", "titi" } { "an47", "aaa.bbb.ccc.2.eee", "var3" } { "any7", "aaa.bbb.ccc.2.ddd", "var12" } {…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
-2
votes
3 answers

How to avoid the display of the 2 first line from a linux command output?

I have a program that displays many line in the output How I can make it display the all output except the first 2 lines?
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
-3
votes
2 answers

How to modify the uptime command on shell?

When I type in uptime in terminal it gives me something like this 16:44:17 up 7:50, load average: 0.31, 0.47, 0.54 I want to make it to be something like this Uptime: 7h 50m Load average: 0.31, 0.47, 0.54 and save it to uptime.txt How can I do…
Squidward
  • 131
  • 3
  • 14
-3
votes
3 answers

How to move and rename a file with random characters in shell?

I have this file: /root/.aria2/aria2.txt and I want to move it to: /var/spool/sms/outgoing/aria2_XXXXX Note that XXXXX are random characters. How do I do that using only the facilities exposed by the openwrt (a GNU/Linux distribution for…
Squidward
  • 131
  • 3
  • 14
1 2 3
12
13