10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Stumped with the formatting of the awk output when used with variables, e.g.:
awk -F, 'BEGIN {OFS=","} print {$2,$3,$4}' $infile1
produces the desired output (with rows), but when echoing the variable below, the output is one continuous line
var1=$(awk -F, 'BEGIN {OFS=","} print... (4 Replies)
Discussion started by: ux4me
4 Replies
2. Shell Programming and Scripting
if
then
echo "Entry Valid : ${x_oug}"
else
echo "Entry Invalid : " 0
fi
In the above code the 3rd line is not working... it does not print anything
I tried following as well .. but no luck!
echo "Entry Valid : ... (13 Replies)
Discussion started by: Chetanz
13 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. Shell Programming and Scripting
Hi,
I'm new here so I want to say hello to everyone first!
I searched google and this forum for a similar problem, but wasn't successful
#! /bin/bash
I'm trying to output (echo) n lines of a text file to the screen (later into another file).
But I have problem with the sed command, it won't... (1 Reply)
Discussion started by: studiologe
1 Replies
5. 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
6. Shell Programming and Scripting
Hi,
i want to create an user-friendly script where you are asked for two numbers. i would like that these two number to be separated with "--" for example, but i can't figure out how to do this.
for example
read -p "Insert lowest and highest value: " min ; echo -n "-- "; read max
so... (3 Replies)
Discussion started by: ezitoc
3 Replies
7. Shell Programming and Scripting
$total=500
echo "scale=2; $val1*100/$total" | bc
echo "scale=2; $val2*100*100/$total" | bc
echo "scale=2; $val3*100/$total" | bc
I want to make the above code to be accomplish in a single echo line.
For instance output:21.3, 44.2, 51.6
How to achieve that, some one please help, i just... (5 Replies)
Discussion started by: alvin0618
5 Replies
8. Shell Programming and Scripting
Hi everyone,
I am trying to create a simple batch file to make SQL backups. this part of it works fine. Currently the script can mysql dump the databases, compress them, delete the .sql, compress the individual tar.gz into one larger one, delete the smaller files, encrypt the final tar.gz and... (1 Reply)
Discussion started by: luma
1 Replies
9. 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
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