I want to make the above code to be accomplish in a single echo line.
For instance output:
How to achieve that, some one please help, i just start learning shell script.
I have a variable that is outputting a lot of space.
here has been 45 lines returned ...
how can I remove the spaces between the "been and the 45"
CODE:
fil_len=`wc -l < coshb.txt`
if ; then
cat coshb.txt | more
echo " "
echo "There has been ${fil_len} lines... (4 Replies)
hi
I have say five variable.
I would ask the user which one they want me to print and then print accordingly.
TEST_1='10.2.3.4'
TEST_2='11.2.3.5'
TEST_3='12.2.3.5'
TEST_4='13.2.3.5'
TEST_5='14.2.3.5'
print_var()
{
echo "Accessing var num $1"
echo TEST$1
#??? But How do... (6 Replies)
I am modifying an existing script and it has the following line:
export SomeEnvVar=`echo ${SomeLocalVar}`
Why wouldn't it just read:
export SomeEnvVar=${SomeLocalVar}
Is there some reason to use echo instead of a direct assignment? :confused: (2 Replies)
I have a code:
echo "First Line ^M Second Line" | mail -s "Lines" abc@gmail.com
Basically, I want to send an email with text in this format:
First Line
Second Line
But there is something wrong with my 'echo'. The ^M is not interpreted as carriage return. Please help. (6 Replies)
Hi All,
I have some 10 files named samp1.csv, samp2.csv,... samp10.csv
Each file having the same number of fields like,
Count, field1, field2, field3.
And a source.csv file which has three fields field1, field2, field3.
Now, i want to find the total count by taking the field1,... (8 Replies)
val=21
total=3250
echo "`echo "scale=2; $val*100/$total" | bc`"
Output:
.64
How do i show the output become "0.64" instead of ".64" ?? Someone can help? (1 Reply)
I've testing the following code:
echo test.txt | cut -d . -f1and get the output "text"
So why can't i assign the command to a variable?
VAR='"echo test.txt | cut -d . -f1"'
echo $VAR (5 Replies)
#!/bin/bash
varA="AAA1"
varB="BBB2"
varC="CCC3"
for proccx in $varA $varB $varC
do
echo "the current name is ????? , the value is $proccx"
echo " "
done
#end of script
I want the output to look something like this:
the current name is varA, the value is AAA1
the current name is... (5 Replies)
Hi,
I am trying to do an addition to a value stored in a variable...
var1=`grep -n "match" sample.txt|cut -d : -f1`
var2=`echo $var1|cut -d " " -f1` (Here i want add +1 to the output value) (4 Replies)
Hallo Team,
I need you you help. I need to sum up all the columns in a .csv file. Lets call the file file1.csv and it looks like below:
$ cat file1.csv... (2 Replies)
Discussion started by: kekanap
2 Replies
LEARN ABOUT DEBIAN
dbar
dbar(1) User Commands dbar(1)NAME
dbar - ASCII progresbar
SYNOPSIS
echo <percentage> | dbar [options] <indicator text>
DESCRIPTION
dbar lets you define static 0% and 100% marks or you can define these marks dynamically at runtime. Static and dynamic marks can be mixed,
in this case the value specified at runtime will have a higher priority.
You can specify ranges of numbers, negative, positive or ranges with a negative min value and positive max value.
All numbers are treated as double precision floating point, i.e. the input is NOT limited to integers.
OPTIONS -l Label to be prepended to the bar (default: "" ).
-nonl
no new line, don't put '
' at the end of the bar (default: do print "
")
-max
Value to be considered 100% (default: 100).
-min
Value to be considered 0% (default: 0).
-s Symbol represeting the percentage value in the meter (default: "=").
-w Number of charcaters to be considered 100% in the meter (default: 25)
EXAMPLES
Static 100% mark or single value input:
echo 25 | dbar -max 100 -l text
Output: text 25% [====== ]
If your 100% mark changes dynamically or 2-values input:
echo "50 150" | dbar
| |
| |__ max value
|
|__ value to display
Output: 33% [======== ]
If your value range is not between [0, maxval] or 3-values input:
echo "50 -25 150" | dbar
| | |
| | |__ max value 100% mark
| |
| |_____ min value 0% mark
|
|________ value to display
Output: 43% [=========== ]
Multiple runs:
for i in 2 20 50 75 80; do echo $i; sleep 1; done | dbar | dzen2
Output: Find out yourself.
ENVIRONMENT
None.
FILES
None.
SEE ALSO dzen2(1)AUTHORS
Program was written by Robert Manea <rob.manea@gmail.com>.
This manual page was written by Jari Aalto <jari.aalto@cante.net> for the Debian GNU system (but may be used by others). Released under
license GNU GPL version 2 or (at your option) any later version. For more information about license, visit
<http://www.gnu.org/copyleft/gpl.html>.
dbar 2012-04-02 dbar(1)