0 Not Found Error In Unix
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us
Sqlplus Not Found Error In Unix
Learn more about Stack Overflow the company Business Learn more about hiring developers or ksh not found error in unix posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is
Command Not Found Error In Unix
a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody file not found error in unix can answer The best answers are voted up and rise to the top Shell script throws a not found error when run from a sh file. But if entered manually the commands work up vote 7 down vote favorite 3 I'm trying to use the following script to generate a sitemap for my website. When I run it as sh thsitemap.sh I get an error like this and creates an ^m not found error in unix empty sitemap.xml file: thsitemap.sh: 22: thsitemap.sh: [[: not found thsitemap.sh: 42: thsitemap.sh: [[: not found thsitemap.sh: 50: thsitemap.sh: Syntax error: "(" unexpected But as the same user root when I manually copy and paste these lines on the terminal, it works without any error and the sitemap.xml file have all the urls. What's the problem? How can I fix this? #!/bin/bash ############################################## # modified version of original http://media-glass.es/ghost-sitemaps/ # for ghost.centminmod.com # http://ghost.centminmod.com/ghost-sitemap-generator/ ############################################## url="techhamlet.com" webroot='/home/leafh8kfns/techhamlet.com' path="${webroot}/sitemap.xml" user='leafh8kfns' # web server user group='leafh8kfns' # web server group debug='n' # disable debug mode with debug='n' ############################################## date=`date +'%FT%k:%M:%S+00:00'` freq="daily" prio="0.5" reject='.rss, .gif, .png, .jpg, .css, .js, .txt, .ico, .eot, .woff, .ttf, .svg, .txt' ############################################## # create sitemap.xml file if it doesn't exist and give it same permissions # as nginx server user/group if [[ ! -f "$path" ]]; then touch $path chown ${user}:${group} $path fi # check for robots.txt defined Sitemap directive # if doesn't exist add one # https://support.google.com/webmasters/answer/183669 if [ -f "${webroot}/robots.txt" ]; then SITEMAPCHECK=$(grep 'Sitemap:' ${webroot}/robots.txt) if [ -z "$SITEMAPCHECK" ]; then echo "Sitemap: http://${url}/sitemap.xml" >> ${webroot}/robots.txt fi fi ############################################## echo "" > $path # grab list of site urls list=`wget -r --delete-after $url --reject=${reject} 2>&1 |grep "\-\-" |grep http | grep -v 'norm
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Isql Not Found Error In Unix
and policies of this site About Us Learn more about Stack Overflow how to redirect error in unix the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Standard Error Unix
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it http://unix.stackexchange.com/questions/155838/shell-script-throws-a-not-found-error-when-run-from-a-sh-file-but-if-entered-ma only takes a minute: Sign up error sh: 0: not found while converting bash function to sh up vote 0 down vote favorite The function below was originally a bash function. I need it to run in busybox 1.22 ash shell. dockerip() { if (( $# != 1 )) then for d in $(docker ps -q) do name=$(docker inspect -f {{.Name}} http://stackoverflow.com/questions/29020744/error-sh-0-not-found-while-converting-bash-function-to-sh $d) ip=$(docker inspect -f {{.NetworkSettings.IPAddress}} $d) printf "%-15s | %15s\n" $name $ip done fi } When the code above is loaded with source and run as dockerip the busybox shell outputs: sh: 0: not found. Not a very helpful error so my question is what does the error mean and what part(s) of the function above aren't busybox 1.22 compatible? shell busybox ash share|improve this question asked Mar 12 '15 at 21:40 SpliFF 25.3k125892 Most likely, the (( $# != 1 )) notation is trying to run the value from $# (plausibly 0) as a command in a double sub-shell. Use if [ "$#" != 1 ] instead? It isn't Bash-specific. –Jonathan Leffler Mar 12 '15 at 21:43 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted This arithmetic expression (( $# != 1 )) is bash syntax. In ash, it's launching 2 nested subshells, then executing the program "$#" with arguments "!=" and "1". Use this instead if [ $# -ne 1 ] share|improve this answer answered Mar 12 '15
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://stackoverflow.com/questions/1968827/shell-scripting-error about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack http://askubuntu.com/questions/504546/error-message-source-not-found-when-running-a-script Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Shell Scripting error up vote 2 down vote favorite I'm very error in new to shell scripting and i've been struggling with the following shell script. I'm posting the script and the commands i used below for your consideration please help me with the mistake i made. # # # DBG=0 RLS=0 ALL=0 CLN=0 print_help_uu() { echo "Usage: $0 -D -R -A -C "; echo "Where -C clean the debug project builds"; echo " -D to build in DEBUG config"; echo " error in unix -R to build in RELEASE config"; echo " -A to build in both configs"; return } # # Main procedure start here # # Check for sufficent args # if [ $# -eq 0 ] ; then print_help_uu exit 1 fi # # Function to clean the project # clean() { if ["$DBG"="1"]; then echo "Cleaning debug" if ["$RLS"="1"]; then echo "cleaning release + debug" else echo "This is bad" fi fi if ["$RLS"="1"]; then echo "Cleaning release " fi return } while getopts "DRAC" opt do case "$opt" in D) DBG=1;; R) RLS=1;; A) DBG=1;RLS=1;; C) CLN=1;; \?) print_help_uu; exit 1;; esac clean done I'm posting the commands i used to run it and the errors i got when using those commands. ---------- ./BuildProject.sh -D ./BuildProject.sh: line 36: [1=1]: command not found ./BuildProject.sh: line 46: [0=1]: command not found ----------- sh BuildProject.sh -D BuildProject.sh: 63: [1=1]: not found BuildProject.sh: 63: [0=1]: not found ----------- sh ./BuildProject.sh -D ./BuildProject.sh: 63: [1=1]: not found ./BuildProject.sh: 63: [0=1]: not found I tried to solve it in soo many ways and googled a lot before posting here. But all my trials went in vain. Please tell me where i'm doing the mistake since i'm new to shell scripti
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Error message 'source: not found' when running a script up vote 13 down vote favorite 1 I am creating a little automated setup script that will modify /etc/profile and $HOME/.profile if some paths are not exported. Then, I'd like to reload these automatically. I have read that source does this, so I fired up my terminal and entered: source /etc/profile source ~/.profile From the terminal, it didn't output any error. However, putting these two commands inside the Bash script results in source: not found. How can I be sure that the script is executed by Bash, even if #!/bin/sh is specified (apparently, it does not guarantee it)? Why would it say that these two sources cannot be found when they are unmistakably there? command-line bash scripts share|improve this question edited Jul 31 '14 at 10:27 Radu Rădeanu 77.6k24168256 asked Jul 30 '14 at 13:20 Yanick Rochon 62331128 add a comment| 3 Answers 3 active oldest votes up vote 18 down vote accepted /bin/sh is not bash. To execute your script with bash, write #!/bin/bash as the first line in your script. The error source: not found is not dropped, because /etc/profile is not found. It's dropped, because source is not found. source is a Bash built-in function, and you don't execute the script with bash. So it's clear why it is not found. Change t