Currently writing a 'git clone script'.
I basicly check wether the $prj_path is its default or if its remote only, if that subdir exists.
Then it checks if the directory, and if so a .git/config exists, and pulls rather than clone the data.
In theory this would work just fine, obviously it doesnt
Also the editor i use provide syntax highlighting, but i fail to see it.
With: set -n
Code:
:) git $ ./clone nqq
# | - GIT Handler - Clone repositry (0.1) | #
line:42 works -- its this one
./clone: line 79: syntax error: unexpected end of file
2 git $
With: set -x
Code:
line:42 works -- its this one
+ source /home/sea/.config/dev-scripts/prjs/nqq/git.conf
++ URL=https://github.com/notepadqq/notepadqq.git
+ cat /home/sea/.config/dev-scripts/prjs/nqq/nqq.conf
# Project configuration for "notepadqq" (nqq)
prj_name="notepadqq"
prj_path="/home/sea/prjs/notepadqq"
useFAS=true
remoteOnly=true
+ echo 'line:54 works only with '\''set -x'\'' but not with '\''set -n'\'''
line:54 works only with 'set -x' but not with 'set -n'
+ echo 'line:55 works --==-- $remoteOnly is true in /bin/bash'
line:55 works --==-- $remoteOnly is true in /bin/bash
+ cd /home/sea/prjs/notepadqq
./clone: line 79: syntax error: unexpected end of file
Code:
Line 1 would be the shebang.
Lines 2-22 would be the disclaimer
Lines 23-35 would set most of the variables (persistent/default).
Assuming the syntax error is starting at the lowest section "Action & Display" its 'if-block'.
Code:
#--line 36
# Variables
#
if [ -z "$4" ]
then if [ ! -z "$1" ] && [ -d "$DIR_CFG/$1" ]
then LBL="$1"
echo "line:$LINENO works -- its this one"
else tui-echo "Please select the label to work with:"
LBL=$(tui-select $(cd "$DIR_CFG";ls|$GREP -v [a-zA-Z]*\.))
fi
else LBL="$4"
fi
[ -f "$CONF_GIT" ] && source "$CONF_GIT"
source "$DIR_CFG/$LBL/$LBL.conf"
set -o nounset
set -n
source "$DIR_CFG/$LBL/git.conf" || exit 1
cat "$DIR_CFG/$LBL/$LBL.conf"
echo "line:$LINENO works only with 'set -x' but not with 'set -n'"
echo "line:$LINENO works --==-- \$remoteOnly is $remoteOnly in $SHELL"
#
# Display and action
#
cd "$prj_path" || exit 1
if $remoteOnly
then echo "line:$LINENO doesnt work -- already missing !!"
if [ -d "$prj_name" ]
then echo "line:$LINENO works?"
[ -d "$prj_name/.git" ] && \
msg="Remote only git repositry already exists" || \
msg="Cloning remote only repositry to $prj_path/$prj_name"
echo "line:$LINENO works"
if tui-status $? "$msg"
then cd "$prj_name"
echo git pull
else echo git clone #"$URL" "$prj_name" ; cd "$prj_name"
fi
else tui-printf -S $RET_TODO "Regular project"
fi
Any ideas what i've overseen please?
Thank you in advance
Hi Everyone,
my script was running Ok, but suddenly it started giving this error.
./update_env_bi.sh: line 54: syntax error near unexpected token `)'
./update_env_bi.sh: line 54: `sed -i "s/PORT=*1/PORT=$2/" repository.xml'
The line 54 has this code.
sed -i "s/PORT=*1/PORT=$2/"... (2 Replies)
Hello,
I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time.
My script:
returned=`tail -50 SapLogs.log | grep -i "Error"`
echo $returned
if ; then
echo "There is no errors in the logs"
fi
And after... (10 Replies)
Hi,
I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help );
#!/bin/bash
#... (16 Replies)
Hi All
I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error.
#!/bin/ksh
#-------------------------------------------------------------------------
# File: ang_stdnld.ksh
#
# Desc: UNIX shell script to extract Store information.... (3 Replies)
Help please! :confused:
I have the following error with the following file and the emails are not arriving to the email, any idea please?
ERROR: ./launch_full_backup.sh: Syntax error at line 28 : `else' is not expected.
FECHA=`date +%d%m%y%H%M`... (2 Replies)
Hello, the following is generating a error at the line "tmprintf(&tmBundle, _TMC("{0}"),Prompt);"... a bit lost as I am diving into this debug...
Thank you in advance...
int H_YesNo(TMCHAR *Prompt, int DefVal)
{
TMCHAR YesNo = '\0';
tmprintf(&tmBundle, _TMC("{0}"),Prompt);
while... (3 Replies)
My script is throwing the error 'Syntax error: redirection unexpected'
My line of code..
cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3
HTML tags are getting in the way but they're needed to... (3 Replies)
--------------------------------------------------------------------------------
Hello, help me please.
I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? :
Command : failed stdout: yes stderr: no... (9 Replies)
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)