Sponsored Content
Top Forums Shell Programming and Scripting Bash Script to Ash (busybox) - Beginner Post 302766227 by sgtbobie on Monday 4th of February 2013 12:01:49 PM
Old 02-04-2013
So looks like your suggestion was spot on the mark for me. Thanks for that!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why generate "ash and bash" different output for same bash script?

Hi, For my bash script, terminal with bash is generate an OK output and program works right. already, terminal with ash have "line 48: syntax error: Bad substitution" output and program don't work. :confused: (0 Replies)
Discussion started by: s. murat
0 Replies

2. UNIX for Dummies Questions & Answers

Differences in BASH and ASH shells regarding if command?

Guys I now have a script that's working in a BASH environment, however one line doesn't appear to be working on an embedded device that has a busybox therefore ASH shell. I've googled but there's very little I can find regarding the ASH shell. In BASH the following line works... if ] ;... (6 Replies)
Discussion started by: Bashingaway
6 Replies

3. Shell Programming and Scripting

[Bash] Beginner at scripting

Hi, I'm a beginner at shell scripting, just started scripting in bash a few days ago. I want to test if the command ls *.jpg returns exit code 2, and if yes I want to execute a new command ls *.jpeg, doing a test on it... and pretty much repeat the procedure. Is this correct? #!/bin/bash... (1 Reply)
Discussion started by: Utherr
1 Replies

4. Shell Programming and Scripting

ash busybox read command not working inside function....

I have a script that has to execute a read command in a function, this is in an ash busybox. The code is... trapcatch () { echo "Ctl-c Detected, what do you want to do?" echo "Please choose the number of one of the following options" echo "1. Jump past this Set" echo "2. Exit... (8 Replies)
Discussion started by: tesser
8 Replies

5. Ubuntu

Bash to Ash, errors and adjustments

I wrote Bash script and now I want to convert it to Ash. One headache is this function: do_adduser() { setaddprompt _arr_add=("Add manually" "Add via TXT" "return to main menu" "exit program") select add_action in "${_arr_add}" do case "$REPLY" in 1)... (7 Replies)
Discussion started by: fzivkovi
7 Replies

6. Ubuntu

Bash to ash port, character-matching problem

I'm trying to convert this working bash script into an Ash script, read -p "Username:" _username if ! ]]; then echo "Valid" else echo "INVALID" fi However, Ash does not recognize the "=~" character. How can I do this? Also, is there a good reference guide, so I... (5 Replies)
Discussion started by: fzivkovi
5 Replies

7. Ubuntu

Convert a bash to ash

hello everybody, i'm a beginner in ash and i want to convert this bash script to ash. this script send a xml file to a nagios server : #!/bin/bash PROGNAME=$(basename $0) RELEASE="Revision 0.3" print_release() { echo "$RELEASE" } print_usage() { echo "" echo "$PROGNAME... (6 Replies)
Discussion started by: mdijoux25
6 Replies

8. Shell Programming and Scripting

Beginner here, how to call a bash-script from python properly?

Hi everyone, i have the following script.sh: foo='lsusb | grep Webcam | cut -c16-18' sudo /home/user/public/usbreset /dev/bus/usb/001/$foo when i try to call this script from python using subprocess.call("script.sh", shell=True) it seems that only 'sudo /home/user/public/usbreset' is being... (6 Replies)
Discussion started by: hilfemir
6 Replies

9. UNIX for Beginners Questions & Answers

Beginner bash - basic shell script 'while' help...

Hi everyone, first time visitor to these forums here. Keeping a long story short I've been attempting to learn how to code in bash. I have VERY little previous experience with coding languages besides simply copying and pasting batch scripts for Windows. So, with that in mind I've followed a... (4 Replies)
Discussion started by: Meta
4 Replies

10. UNIX for Beginners Questions & Answers

Bash beginner

Hello so I've stored some csv data to be read into variables like this Name,Team,Shop,Shoe etc,etc,etc,etc Code: sep="," { while IFS=$sep read Name Team Shop Shoe do count=1 dirname=$Name while do ((count++)) dirname="${Name}$count" (4 Replies)
Discussion started by: darklord173
4 Replies
sockatmark(3XNET)				   X/Open Networking Services Library Functions 				 sockatmark(3XNET)

NAME
sockatmark - determine whether a socket is at the out-of-band mark SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ] #include <sys/socket.h> int sockatmark(int s); DESCRIPTION
The sockatmark() function determines whether the socket specified by the descriptor s is at the out-of-band data mark. If the protocol for the socket supports out-of-band data by marking the stream with an out-of-band data mark, the sockatmark() function returns 1 when all data preceding the mark has been read and the out-of-band data mark is the first element in the receive queue. The sockatmark() function does not remove the mark from the stream. RETURN VALUES
Upon successful completion, the sockatmark() function returns a value indicating whether the socket is at an out-of-band data mark. If the protocol has marked the data stream and all data preceding the mark has been read, the return value is 1. If there is no mark, or if data precedes the mark in the receive queue, the sockatmark() function returns 0. Otherwise, it returns -1 and sets errno to indicate the error. ERRORS
The sockatmark() function will fail if: EBADF The s argument is not a valid file descriptor. ENOTTY The s argument does not specify a descriptor for a socket. USAGE
The use of this function between receive operations allows an application to determine which received data precedes the out-of-band data and which follows the out-of-band data. There is an inherent race condition in the use of this function. On an empty receive queue, the current read of the location might well be at the "mark", but the system has no way of knowing that the next data segment that will arrive from the network will carry the mark, and sockatmark() will return false, and the next read operation will silently consume the mark. Hence, this function can only be used reliably when the application already knows that the out-of-band data has been seen by the system or that it is known that there is data waiting to be read at the socket, either by SIGURG or select(3C). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
recv(3XNET), recvmsg(3XNET), select(3C), attributes(5), standards(5) SunOS 5.10 1 Oct 2003 sockatmark(3XNET)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy