Sponsored Content
Top Forums Shell Programming and Scripting Bash Script to Ash (busybox) - Beginner Post 302765831 by Scrutinizer on Sunday 3rd of February 2013 02:44:37 PM
Old 02-03-2013
In that case the regular IFS could be used, i.e. any combination whitespace that consists of spaces, tabs or linefeeds.. So the use of spaces or tabs as field separator would not need to be excluded...

Last edited by Scrutinizer; 02-03-2013 at 03:52 PM..
This User Gave Thanks to Scrutinizer For This Post:
 

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
fspec(4)						     Kernel Interfaces Manual							  fspec(4)

NAME
fspec - format specification in text files DESCRIPTION
It is sometimes convenient to maintain text files on the HP-UX system with non-standard tabs, (meaning tabs that are not set at every eighth column). Generally, such files must be converted to a standard format - frequently by replacing all tabs with the appropriate num- ber of spaces - before they can be processed by HP-UX system commands. A format specification occurring in the first line of a text file specifies how tabs are to be expanded in the remainder of the file. A format specification consists of a sequence of parameters separated by blanks and surrounded by the brackets and Each parameter consists of a keyletter, possibly followed immediately by a value. The following parameters are recognized: The parameter specifies tab settings for the file. The value of tabs must be one of the following: 1. A list of column numbers separated by commas, indicating tabs set at the specified columns; 2. A followed immediately by an integer n, indicating tabs at intervals of n columns; 3. A followed by the name of a ``canned'' tab specification. Standard tabs are specified by or equivalently, etc. Recognized canned tabs are defined by the command (see tabs(1)). The parameter specifies a maximum line size. The value of size must be an integer. Size checking is performed after tabs have been expanded, but before the margin is inserted at the beginning of the line. The parameter specifies a number of spaces to be inserted at the beginning of each line. The value of margin must be an integer. The parameter takes no value. Its presence indicates that the line containing the format specification is to be deleted from the converted file. The parameter takes no value. Its presence indicates that the current format is to prevail only until another format specification is encountered in the file. Default values (assumed for parameters not supplied) are and If the parameter is not specified, no size checking is performed. If the first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The following is an example of a line containing a format specification: If a format specification can be disguised as a comment, it is not necessary to code the parameter. Several HP-UX system commands correctly interpret the format specification for a file. Among them is which can be used to convert files to a standard format acceptable to other HP-UX system commands. SEE ALSO
ed(1), newform(1), tabs(1). fspec(4)
All times are GMT -4. The time now is 12:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy