10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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)
Discussion started by: Kevin Tivoli
4 Replies
3. Shell Programming and Scripting
#!/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)
Discussion started by: ajp7701
5 Replies
4. UNIX for Dummies Questions & Answers
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)
Discussion started by: jl487
5 Replies
5. Shell Programming and Scripting
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)
Discussion started by: alvin0618
1 Replies
6. Shell Programming and Scripting
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)
Discussion started by: johnwilliams.sp
8 Replies
7. UNIX for Dummies Questions & Answers
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)
Discussion started by: laiko
6 Replies
8. Shell Programming and Scripting
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)
Discussion started by: shellburger
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: sabina
6 Replies
10. UNIX for Dummies Questions & Answers
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)
Discussion started by: jagannatha
4 Replies