10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have in one shell variable, op, a string which represents a "test operator" in a ] construct, for instance -d or -n or -s, an in another shell variable, arg, some arbitrary string. What I want to achieve, is basically this:
#This is INCORRECT code. I just want to get you the idea, what I'm... (7 Replies)
Discussion started by: rovf
7 Replies
2. 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
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 all
i am forced to use tcsh at work but i want to use zsh, so i have added this to my .cshrc
if (! $?STARTTCSH) then
if ("$tty" != "" && -x /bin/zsh) exec /bin/zsh
exit
endif
but this now stopped me going back to tcsh if i need to, is there a way to do this, i would... (7 Replies)
Discussion started by: ab52
7 Replies
5. Shell Programming and Scripting
Hi guys,
I confused about syntax used in OR script as follow:
I have this sample file separated by "|" containing:
January|Month No. 1
February|Month No. 2
March|Month No. 3
April|Month No. 4
May|Month No. 5
June|Month No. 6
July|Month No. 7
August|Month No. 8
September|Month No. 9... (11 Replies)
Discussion started by: cgkmal
11 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. UNIX for Dummies Questions & Answers
hi,
In bash,
$ bind -P | grep yank-last
yank-last-arg can be found on "\M-.", "\M-_".
this allows me to press ALT key and the period (.) to yank the last argument of
the previous command line into the current command line.
How can I get the same behavior in zsh ?
Thanks ... (0 Replies)
Discussion started by: Andrewkl
0 Replies
8. 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
9. Programming
How do I interpret the following ternary operation?
fn_max(var_type a,var_type b,var_type c)
{
var_type t;
return(t=((t>a?:t;a)>b)?:t;b)>c?:t;c)
}
Thanks (1 Reply)
Discussion started by: naan
1 Replies
10. Shell Programming and Scripting
hi there
I'm looking for tutorials about zsh (beginners to experts)
can you give me addresses please?
thx a lot (3 Replies)
Discussion started by: SpY974
3 Replies