You will need to explain your problem a little better.
1) You are creating a script in vi. I do not understand what you mean by "do you include...".
Scripts are flat ASCII files with shell or program specific commands. Please clarify your question.
2) I assume you mean in the execution of the saved scriptfile... if this is the case, then you will have to change the attribute of the scriptfile to allow for execution. Please see "chmod" for details. If you would like to change the file to executable:
3) Your post indicated that you chmod'd the file, thus the last thing your should check is the PATH variable to make sure that the residing directory is included or execute the file with a preceding "./" ,as in ./scriptfile
hi
I want to call a shell script in C program
the script is : ssh -t user@remote sh /<remote>home/user/<file_name>.sh
and other several commands
C program : Call this script and the retrive the task that is been done in <file_name>.sh file
can any one tell me how... (5 Replies)
I want to add lines in my script dynamically.
My script:
...
echo addscript
end addscript
...
Lines to add: (can be put in a file and can be added)
cp /opt/script1.sh opt/script1_org.sh
sed 's/testusr/'${FUNCTID}'/g' /opt/script1.sh > ./tmpfile
mv ./tmpfile /opt/script1.sh... (1 Reply)
I'm new in this.
In C/C++, you define variables in one header file & then simply include it in any files where those variables are referenced.
I tried to include a header named DefineVars- which initializes all the globals- but when I add the line "DefineGlobals" at the begining of another... (2 Replies)
Hi Gurus,
Is it possible to include perl script with in the unix shell script?
What would be the general syntax?
In the above case, is it required to write the below first two lines of codes?
#!usr/bin/sh -x
#!usr/bin/perl -w
Thanks in advance / Mysore Ganapati. (1 Reply)
Hello,
I have a script and a second file that contains all parameters needed for the script.
How can I include this file in the script ?
I tried source but I have a "no such file or directory" error.
:) (1 Reply)
Hi,
i want to write a script that executes a program (exec?) .
this program then requires a filename as input.
how do i give it this input in the script so the program will be complete run and close by the script.
e.g.
exec prog.exe
program then asks for filename
"enter filename:"... (1 Reply)
# dbc "delete from alert;"
DELETE 10
#
However, the script created below generates an error that command does not exits. Can any one please exist.
script.sh:
#!/bin/sh
dbc "delete from alert;" >>$TASKLOGFILE
./script.sh: line 38: dbc: command not found
can any one please... (2 Replies)
Hi guys i have written a script which takes the options given to him and execute itself accordingly.
for example
if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a
or if a doctortux is needed to run in... (4 Replies)
Hi,
I have a script I am developing (actually more than 1 just now).
1st part - executes SQL in a 2nd script.
2nd part - reformats the output of the sql into a csv
Problem:
How am I able to run the SQL from the first script? I assume there is a sql command? I generally use isql when... (6 Replies)
Discussion started by: mcclunyboy
6 Replies
LEARN ABOUT PHP
date_default_timezone_get
DATE_DEFAULT_TIMEZONE_GET(3) 1 DATE_DEFAULT_TIMEZONE_GET(3)date_default_timezone_get - Gets the default timezone used by all date/time functions in a script
SYNOPSIS
string date_default_timezone_get (void )
DESCRIPTION
In order of preference, this function returns the default timezone by:
o Reading the timezone set using the date_default_timezone_set(3) function (if any)
o Prior to PHP 5.4.0
only: Reading the $TZ environment variable (if non empty)
o Reading the value of the date.timezone ini option (if set)
o Prior to PHP 5.4.0
only: Querying the host operating system (if supported and allowed by the OS). This uses an algorithm that has to guess the time-
zone. This is by no means going to work correctly for every situation. A warning is shown when this stage is reached. Do not rely
on it to be guessed correctly, and set date.timezone to the correct timezone instead.
If none of the above succeed, date_default_timezone_get will return a default timezone of UTC.
RETURN VALUES
Returns a string.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.4.0 | |
| | |
| | The TZ environment variable is no longer used to |
| | guess the timezone. |
| | |
| 5.4.0 | |
| | |
| | The timezone is no longer guessed from informa- |
| | tion available through the operating system as |
| | the guessed timezone can not be relied on. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Getting the default timezone
<?php
date_default_timezone_set('Europe/London');
if (date_default_timezone_get()) {
echo 'date_default_timezone_set: ' . date_default_timezone_get() . '<br />';
}
if (ini_get('date.timezone')) {
echo 'date.timezone: ' . ini_get('date.timezone');
}
?>
The above example will output something similar to:
date_default_timezone_set: Europe/London
date.timezone: Europe/London
Example #2
Getting the abbreviation of a timezone
<?php
date_default_timezone_set('America/Los_Angeles');
echo date_default_timezone_get() . ' => ' . date('e') . ' => ' . date('T');
?>
The above example will output:
America/Los_Angeles => America/Los_Angeles => PST
SEE ALSO date_default_timezone_set(3), "List of Supported Timezones".
PHP Documentation Group DATE_DEFAULT_TIMEZONE_GET(3)