Sponsored Content
Top Forums Shell Programming and Scripting Works from bash prompt, but not from script! Post 302165900 by tahsinaltay on Saturday 9th of February 2008 06:30:24 PM
Old 02-09-2008
Thanks. Good infos
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

substring command works but only in BASH shell

I am having trouble running a .sh file. The code 'x=${file_name:0:$z-11}' is giving me a bad substitution error. However when I run in BASH it works. Thing is when this goes to production the .sh will not be running in BASH. Is there a way to substring a string not in BASH or a way to invoke... (2 Replies)
Discussion started by: edwardtk11
2 Replies

2. Shell Programming and Scripting

Script works with bash 3.0 but not 3.2.

Hello, So my knowledge of bash scripting is not that great and I have been trying to solve this problem on my own for awhile to no avail. Here's the error I get when running it with an OS that uses bash 3.2.x: testagain.sh: line 10: *-1: syntax error: operand expected (error token is... (2 Replies)
Discussion started by: forkandspoon
2 Replies

3. OS X (Apple)

Bash script prompt for sudo password?

I'm making a script that will be a double clickable .command file and I need it to prompt for the users admin password. So far I have: if ]; then sudo -p "Please enter your admin password: " date 2>/dev/null 1>&2 if ; then echo "You entered an invalid password... (2 Replies)
Discussion started by: PatGmac
2 Replies

4. UNIX for Dummies Questions & Answers

FTP that works correctly in command prompt and shows issue in UNIX server

Hi All, FTP ports opens with the given user name and password and allows to download file through COMMAND PROMPT. Code as below: H:\>ftp ftpxxxxx Connected to entvc2ft07-pub.xxxxx.com. 220 Microsoft FTP Service User (entvc2ft07-pub.xxxxx.com:(none)): userxxxxx 331 User name okay, need... (1 Reply)
Discussion started by: vijayalakshmi.r
1 Replies

5. UNIX for Dummies Questions & Answers

Bash script dont works when executed as cronjob

Hello, i have cronjob: crontab -l * * * * * pkill -f domexpcheck;sh /root/dom/domexpcheck.sh it runs: /var/log/cron Mar 25 12:11:01 vps crond: (root) CMD (pkill -f domexpcheck;sh /root/dom/domexpcheck.sh) but somehow script dont run properly via cronjob. But when i execute cronjob... (7 Replies)
Discussion started by: postcd
7 Replies

6. Shell Programming and Scripting

Calling bash script works when called manually but not via Cron?

Hi, I've got a Bash backup script I'm trying to run on a directory via a cron job nightly. If I ssh in and run the script manually it works flawlessly. If I set up the cron to run evertything is totally messed up I don't even know where to begin. Basically the path structure is ... (6 Replies)
Discussion started by: wyclef
6 Replies

7. Shell Programming and Scripting

Script in bash that works only some of the time

I ran this script yesterday (in the background) /usr/bin/nohup myfilelocation/myscriptname.sh & the script worked perfectly. i ran it today (also in the background) and just sat there. So i killed it and ran it normally and it worked perfectly. Anyone suggest why it just sat there and... (8 Replies)
Discussion started by: twinion
8 Replies

8. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

9. Shell Programming and Scripting

Linux/bash Script only working if executed from shell prompt

Hi, maybe I'm asking a VERY dumb question, but would anybody out there tell me, why this f****** script won't work if executed as a cronjob, but works fine if executed from a shell prompt? #! /bin/bash set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin date >>... (3 Replies)
Discussion started by: beislhur
3 Replies

10. UNIX for Beginners Questions & Answers

Command works interactively but not in bash script

The below command works in the terminal interactively but not as part of a bash script. I though maybe I needed to escape the "$dir" so it isn't interpreted literally, but that's not it. Thank you :). interactively in terminal dir=/path/to new=$(ls "$dir"/*.csv -tr | tail -n 1) && echo... (6 Replies)
Discussion started by: cmccabe
6 Replies
GEOIP_DB_GET_ALL_INFO(3)						 1						  GEOIP_DB_GET_ALL_INFO(3)

geoip_db_get_all_info - Returns detailed information about all GeoIP database types

SYNOPSIS
array geoip_db_get_all_info (void ) DESCRIPTION
The geoip_db_get_all_info(3) function will return detailed information as a multi-dimensional array about all the GeoIP database types. This function is available even if no databases are installed. It will simply list them as non-available. The names of the different keys of the returning associative array are as follows: o "available" -- Boolean, indicate if DB is available (see geoip_db_avail(3)) o "description" -- The database description o "filename" -- The database filename on disk (see geoip_db_filename(3)) RETURN VALUES
Returns the associative array. EXAMPLES
Example #1 A geoip_db_get_all_info(3) example This will print the array containing all the information. <?php $infos = geoip_db_get_all_info(); if (is_array($infos)) { var_dump($infos); } ?> The above example will output: array(11) { [1]=> array(3) { ["available"]=> bool(true) ["description"]=> string(21) "GeoIP Country Edition" ["filename"]=> string(32) "/usr/share/GeoIP/GeoIP.dat" } [ ... ] [11]=> array(3) { ["available"]=> bool(false) ["description"]=> string(25) "GeoIP Domain Name Edition" ["filename"]=> string(38) "/usr/share/GeoIP/GeoIPDomain.dat" } } Example #2 A geoip_db_get_all_info(3) example You can use the various constants as keys to get only parts of the information. <?php $infos = geoip_db_get_all_info(); if ($infos[GEOIP_COUNTRY_EDITION]['available']) { echo $infos[GEOIP_COUNTRY_EDITION]['description']; } ?> The above example will output: GeoIP Country Edition PHP Documentation Group GEOIP_DB_GET_ALL_INFO(3)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy