10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am getting this error Syntax error: `]' unexpected. Did I do something wrong with elif? Does ksh not like double brackets?
if ]; then
#echo hi
source ~/.bashrc;
elif ]; then
#echo hi
source ~/.kshrc;
fi (5 Replies)
Discussion started by: cokedude
5 Replies
2. Shell Programming and Scripting
Hi,
I'm new to the Ash shell so my apologies if this is well known. In normal maths and other shells and languages I've used, the modulo operator always returns a positive remainder. For example see this discussion (first post so I can't hyperlink it):
... (11 Replies)
Discussion started by: FleetFoot
11 Replies
3. 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
4. Shell Programming and Scripting
unzip file.zip
if ] ; then
echo "Success"
else
echo "Some failure."
fi ;
I tried many time to detect the unzip error, but it keep show the syntax error wherever how I change the syntac. Hope someone can help me fix the issue, thanks.
Please use code tags next time for your code and... (5 Replies)
Discussion started by: duncanyy
5 Replies
5. Shell Programming and Scripting
Does anyone know how this line in bash works?
local gotbase= force= nicelevel corelimit
local pid base= user= nice= bg= pid_file=
local cgroup=
These lines are part of the daemon function inside the "functions" file at /etc/init.d in RH. (3 Replies)
Discussion started by: Rameshck
3 Replies
6. UNIX for Dummies Questions & Answers
im kinda new to shell scripting so i need some help
i try to run this script and get the error code
> 5 ")syntax error: operand expected (error token is "
the code for the script is
#!/bin/sh
#
# script to see if the given value is correct
#
# Define errors
ER_AF=86 # Var is... (4 Replies)
Discussion started by: metal005
4 Replies
7. 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
8. Shell Programming and Scripting
this is my file:
#!/bin/sh
a=`cat /home/$USER/Desktop/lol`
c=`cat /home/$USER/Desktop/lol1`
if ; then
echo "$a = $c"
else
echo "They are not equal"
fi
The lol file contains 1aa and the lol1 file contains 1aa as well.
Unfortunately the output is
Even when I put -eq instead of == I get
... (9 Replies)
Discussion started by: hakermania
9 Replies
9. Shell Programming and Scripting
Hi all,
Am very new to Unix and am currently Involved in Migrating some Shell Scripts from AIX 4 to Solaris 10.
While using teh for loop am getting the below error:
$ echo $SHELL
/usr/bin/ksh
$ for file in $(ls *SEBE*)
syntax error: `$' unexpected
while the same works without issue on... (4 Replies)
Discussion started by: paragkhanore
4 Replies
10. Shell Programming and Scripting
Hello all,
I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`:
#!/usr/bin/ksh
if ] then
mailx... (5 Replies)
Discussion started by: alan
5 Replies