10 More Discussions You Might Find Interesting
1. Linux
Hello,
For some reason i dont remember, i currently believe (but beeing unsure) that printf is available on more diffrent systems (unix, bsd, linux, ??) than echo is.
Could someone please enlighten me, whether this is true or not?
Thank you
PS:
I just found pages about the diffrences of... (3 Replies)
Discussion started by: sea
3 Replies
2. Shell Programming and Scripting
Hello
I want to check whether certain arguments were passed to the script, and when those are, not doing a log entry.
If those arguments are not passed, always do a log entry (*new call*).
What currently i have is this:
echo "${@}"|grep -q \\- || \
tui-log -e "$LOG" "\r---- New call $$... (4 Replies)
Discussion started by: sea
4 Replies
3. Shell Programming and Scripting
Hello script guru's
as i write more and more code i always block at managing output... either writing to standard out, writing to files via std out (log, temp file, etc). Don't get me wrong 99% of the time it DOES the job but maybe there is more efficient.
I'm writing a small script to... (2 Replies)
Discussion started by: maverick72
2 Replies
4. UNIX for Dummies Questions & Answers
Hello Friends,
I am a new learner of Unix & need to understand below script as start up,
Can anyone explain the meaning of each line listed below.
Thanks for your time.
#!/usr/bin/ksh
PARAMS=$1
#echo "parms passed is $PARAMS @"
STATUS=`echo ${PARAMS} | cut -d: -f1`
JOBNAME=`echo... (9 Replies)
Discussion started by: DK2014
9 Replies
5. Shell Programming and Scripting
My requirement is need to add spaces to the string with the dynamic value to printf... this is a part of shell script ..which i have , the length is not static ...
length=15
value="1234567890"
printf "%-"$length"s\n" "$value";
The result it is printing is ... i am not sure y it is... (19 Replies)
Discussion started by: greenworld123
19 Replies
6. Shell Programming and Scripting
#!/usr/bin/ksh
var1="Hi World"
var2="Morning"
var3=$(echo "$var1" \n "$var2")
echo $var3
var3=$(printf "$var1 \n $var2")
echo $var3
Output
Any way to get
in my $var3 ? (7 Replies)
Discussion started by: dahlia84
7 Replies
7. Shell Programming and Scripting
i have written small script as follows:
name="hi hello"
printf "%-20s" $name
This gives me strange output. -20s format is applied on both word of string. i.e it displays both word hi and hello in space of 20 length.
I want to display entire string "hi hello" in length of 20 space.
plz... (2 Replies)
Discussion started by: admc123
2 Replies
8. Shell Programming and Scripting
I am trying to make a script that randomly generates 4 sets of numbers with decimal points. Then it outputs that to a variable and a file. This is what I have:
#!/bin/bash
printf -v RANDOM_2 "%s\n" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM"
printf... (3 Replies)
Discussion started by: pkohn11
3 Replies
9. Shell Programming and Scripting
I want to print a colored line using bash. I want to print:
Smtp status
where "Smtp status" will be in yellow and will be in green.
Thanks. (2 Replies)
Discussion started by: proactiveaditya
2 Replies
10. Shell Programming and Scripting
Hello all,
I want to be able to create a script on the fly from another script by echoing lines into a file, but am running into difficulty, as it isn't working right. What am I doing wrong?
echo "for i in `grep $FRAME /root_home/powermt.sort.fil |awk '{print $7}'`" > pvtimout_set.sh... (5 Replies)
Discussion started by: LinuxRacr
5 Replies