Sponsored Content
Operating Systems Linux Ubuntu Bash to ash port, character-matching problem Post 302910265 by bakunin on Wednesday 23rd of July 2014 10:43:43 AM
Old 07-23-2014
I'd like to add that in any case, letting variable names start with underscores is a problematic practice, even if it is allowed. Consider:

Code:
_foo="bar"
echo $_foo

_="bar"
echo $_

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

character matching

Is there a way to pull out a character at a time from a work in unix, using a shell script? (1 Reply)
Discussion started by: Rukshan
1 Replies

2. UNIX for Dummies Questions & Answers

Matching character

Alright, I am stuck here. I have this variable that stores the word = HELLO and I have converted it it to ----- I have asked user to input one character at a time. SAy, if they enter E. Therefore, I need to search 2nd character and input E there. makes it -E--- (other checkings have been... (2 Replies)
Discussion started by: felixwhoals
2 Replies

3. 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

4. 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

5. Shell Programming and Scripting

Ash shell character corrupted after gdbserver

I am trying to debug something using gdbserver, after the successful/YET REALLY SLOW debug session i see that the ash shell on the the target under debug is messed up. Probably because gdbserver tries to open the core file which is binary. How do i recover from it? Also any ideas to speed up... (2 Replies)
Discussion started by: dragonpoint
2 Replies

6. Shell Programming and Scripting

Bash Script to Ash (busybox) - Beginner

Hi All, I have a script that I wrote on a bash shell, I use it to sort files from a directory into various other directories. I have an variable set, which is an array of strings, I then check each file against the array and if it is in there the script sorts it into the correct folder. But... (5 Replies)
Discussion started by: sgtbobie
5 Replies

7. 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

8. 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

9. UNIX for Beginners Questions & Answers

Escape bash-special character in a bash string

Hi, I am new in bash scripting. In my work, I provide support to several users and when I connect to their computers I use the same admin and password, so I am trying to create a script that will only ask me for the IP address and then connect to the computer without having me to type the user... (5 Replies)
Discussion started by: arcoa05
5 Replies

10. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies
DBAR(1) 						      General Commands Manual							   DBAR(1)

NAME
dzen2-dbar - simple gadget that you can use in combination with dzen to display a progressbar. SYNOPSIS
dzen2-dbar [-w characters] [-s symbol] [-min minvalue] [-max maxvalue] [-l string] [-nonl] DESCRIPTION
dbar is an application that generates semi graphical progress meters, from some values you supply to it. See the usage examples for a description of the expected input format. OPTIONS
A summary of options is included below. -max Value to be considered 100% (default: 100) -min Value to be considered 0% (default: 0) -w Number of charcaters to be considered 100% in the bar (default: 25 ) -s Symbol represeting the percentage value in the bar (default: = ) -l label to be prepended to the bar (default: '' ) -nonl no new line, don't put '0 at the end of the bar (default: do print '0) USAGE EXAMPLES
Static 0% and 100% mark or single value input: Command: echo 25 | dbar -m 100 -l Sometext Output: Sometext 25% [====== ] If your 100% mark changes dynamically or 2-values input: Command: echo "50 150" | dbar Output: 33% [======== ] If your value range is not between [0, maxval] or 3-values input: Command: echo "50 -25 150" | dbar Output: 43% [=========== ] Dbar was written by Robert Manea. This manual page was written by bertagaz <bertagaz@ptitcanardnoir.org>, for the Debian project (but may be used by others). Jan 01 2008 DBAR(1)
All times are GMT -4. The time now is 08:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy