Hi All,
I am working with CentOS 4.8 and starting ksh scripting. current version is "pdksh-5.2.14-30.6".
i have written a case statement, syntax and code is fine but still i am having " syntax error at line 4: `newline' unexpected" whereas there is no newline in there.
Code:
CASE() {
Hi Guys,
I am relatively new to scripting at the moment and am struggling to get the following function to work. For some reason it does not recognise the arithmatic symbol when i select option1. Any help would be greatly appreciated.
Code:
menu ()
{
echo "=============="
echo "Calculator"
echo "=============="
echo "1. Divide"
echo "2.
hi
i am new to shell scripting.
i was going thru the part option and arguments.
The situation dictates.Another alternative would be something lilkefunction fail() {
case $1 in
lvchange)
<error message, save tmp, etc>
;;
mount)
<other error message + cleanup>
;;
esac
exit $err_code
}
echo -n "activating lv ..."
echo "activating lv" >> $log
lvchange -val "$lv" &> "$tmp" || fa
Hi guys...was trying to use while loop and a sentry to prompt user input again if an invalid option was entered...but somehow I got a "while" unmatched error...The code is as below:
Code:
#!/system/bin/sh
finsh=0
while [ $finish -ne 0 ]
do
echo "Please select an option: "
echo "1. One" echo "2. Two"
echo "3. Three"
echo "4.
Hi,
I have a file in the following format
Code:
"SYLVESTER,WILLARD G"|"S00633600"|"221052958A"|"H2256"|"015"|""|"00000042BASJ"|"665303"|"N"|"20100211"|"380.4"|""|""|""|"5400"|"20110218"|""|"20110218"|"FEESC&qu
can anybody tell me why this code does not work?
Code:
cat x1.ksh
#!/bin/ksh
set -x
echo "|$#|"
while [ $# -gt 0 ]
do
case $1 in
--+([kK])
shift
K=$1
;;
*)
echo "Here I am"
i have 2 strings with values below which are read from a file
1 ---> end
2 ---> string(1)newline="\n";
which need to be compared inside an if block as below
Code:
if [ ${LAST_1_LINE} == "end" -a ${LAST_2_LINE} == "string\(\1\)newline\=\"\\n\"\;" ]
then
echo "pattern match"
fi
but the above code is not working
Hi guys,i am trying to set up Vim as my C++ IDE since 2 days and no success so far.I have installed Vim pacman -Q vim
vim 7.3.661-1I have downloaded vim-latex and clang tar balls,extract and place appropriate directorys in ~/.vim e.g.