10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
split($7,a," "); date = a; time = a
split(date,d,"/"); month = sprintf("%02d",d); day = sprintf("%02d",d); year = 2000 + d % 100
split(time,t,":"); hour=t; min=t
hour >= 12? { hour=hour-12; amPm=" PM" } : amPM=" AM"
hour == 0? hour=12
time=sprintf("%02d",hour)":"sprintf("%02d",min)amPm
... (4 Replies)
Discussion started by: Michael Stora
4 Replies
2. Shell Programming and Scripting
Hello all,
I am writing up an input file and I was hoping I could get some guidance as to how to best consolidate these 2 awk statements for 1 while loop.
Here's my input file
# cat databases.lst
#NOTE: These entries are delimited by tabs "\t"
#oracleSID name/pass
#
db11 ... (2 Replies)
Discussion started by: Keepcase
2 Replies
3. UNIX for Dummies Questions & Answers
hi,
i have a bash script that i want to receive a a string from another bash file. But because the string has a dot in the middle it gives me an error. The error is in this line:
let valor=$1
and the value passed is rules.txt
the error is:
let: valor=rules.txt: syntax error: invalid... (2 Replies)
Discussion started by: limadario
2 Replies
4. Shell Programming and Scripting
Hi
I use awk command to delete the first blanc line of a file:
awk '/^$/ && !f{f=1;next}1' infile > outfile
can somebody please explain me what the last "1'" in !f{f=1;next}1' stands for... Thansk a lot -A (3 Replies)
Discussion started by: aoussenko
3 Replies
5. Shell Programming and Scripting
Hi,
Can someone give me an example of how to use zsh's ternary operator?
I tried:
# a=1
# c=( a ? "true" : "false" )
and got:
zsh: no matches found: ?
I'm running zsh 4.2 on RHEL AS 4.
Thanks!
Paul (1 Reply)
Discussion started by: paul99
1 Replies
6. Shell Programming and Scripting
Hi All,
can some one figure out the syntax issue here. How to overcome this?
#!/bin/sh
$ HFR_MAIL=NO
$ PRP_MAIL=NO
$ MC_MAIL=NO
$ if && && ]; then
> echo "NO "
> else
> echo "YES"
> fi
test: unknown operator NO
$ if && && ]; then
> echo "NO"
> else
> echo "YES"
>... (4 Replies)
Discussion started by: shellscripter
4 Replies
7. Shell Programming and Scripting
When i tyr this, it gives me a syntax error...i tried removing quotes,removing spaces,replacing -eq with '='.. Can somebody suggest that is the problem?
if ]; then (4 Replies)
Discussion started by: dba.admin2008
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
Have to check file names in some given directory.
SO, What is the right syntax here:
*$3*=="'$object_list'" - just wanted to check if $3 is in the object_list.
And also, Do I need so many quotes around? (5 Replies)
Discussion started by: Leo_NN
5 Replies
9. Shell Programming and Scripting
I am trying to print the remaing fields and field numbers beginning with a field 'xyz'
#cat abc
test1:test2:xyz:test3:test4:test5
#cat def
test1:test2:test3:xyz:test4:test5
desired output is to be able to print NF and any trailing fields separated by':'
test3 3
or
test4 3
or
test5... (4 Replies)
Discussion started by: prkfriryce
4 Replies
10. Shell Programming and Scripting
Hi there could someone explain what is happening in the following function/statement for me, im just a little confused
code = 'BEGIN{FS=","}
{
printf ("%-11s,%s%s%s,%07.2f,%14s,%-3s\n",$1,substr($2,9,2),substr($2,6,2),substr($
2,3,2),$9,$10,$12)
}
this function is called later in the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies