Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Determine FULL name of current script Post 302416409 by msb65 on Monday 26th of April 2010 11:02:48 AM
Old 04-26-2010
Determine FULL name of current script

Hi everyone,

Is there a slick way to determine the FULL name of a script that is running?

The variable
Code:
${0}

just gives the relative path name.

I guess I could just do the following:

Code:
FULL_SCRIPT_NAME=${PWD}${0}

Although that's pretty simple is there another way that I am missing?

Thanks a lot.

Mike
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to determine the script is called from CRON?

Hello expert, What I want is to determine whether the script is called from CRON or it is executed interactively? I tried the following but no luck: #!/bin/ksh cronID=`pgrep -x cron` GPID=`ps -ef -o ppid,pid | grep " $PPID$" | awk '{print $1}'` if ; then echo I am being run... (15 Replies)
Discussion started by: wes_brooks
15 Replies

2. UNIX for Advanced & Expert Users

cannot determine current directory

Hi, when I execute some simple commands on my solaris system, I am getting the following warning message: Could anybody tell me what could be the reason Ex:- If I give the command, which ls Warning: cannot determine current directory ... (15 Replies)
Discussion started by: axes
15 Replies

3. Shell Programming and Scripting

Maintain full path of a script in a var when sourcing it from a different script

Hi All, I've searched through the forum for a solution to this problem, but I haven't found anything. I have 2 script files that are in different directories. My first script, let's call it "/one/two/a.sh" looks like this: #!/bin/sh IN_DIR=`dirname $0` CUR_DIR=`pwd` cd $IN_DIR... (4 Replies)
Discussion started by: mrbluegreen
4 Replies

4. Shell Programming and Scripting

determine if the script has been invoked manually or not?

Hi, Is there a way to determine if the script has been invoked manually or not( might be invoked by a schedular or crontab)? Thanks, (8 Replies)
Discussion started by: hitmansilentass
8 Replies

5. UNIX for Dummies Questions & Answers

Installer script needs to determine own location...

My n00b question: I am trying to write a script that I can place on a flash drive and then move from computer to computer and install a file, which is bundled with the script. (ie the script is at /Volumes/FlashDrive/Folder/Script, the file is at /Volumes/FlashDrive/Folder/File) So far I have... (1 Reply)
Discussion started by: madmacs
1 Replies

6. HP-UX

how could I use shell script to determine which CPU structure

how could I use shell script to determine which CPU structure because I found that I compile my program under Itanium base that cannot run on the PA-RISC base but PA-RISC program can run on Itanium base i would like to use shell script to know which CPU structure it is,how could i do thanks (1 Reply)
Discussion started by: alert0919
1 Replies

7. UNIX for Dummies Questions & Answers

Script to determine logged in time

Hi all So I am thinking my inability to cope with math is bogging me down here so Im asking for help. I want to determine how long a user has been logged on for by using the date and who commands to determine the time they have been logge don. My problem is that I keep getting the wrong... (2 Replies)
Discussion started by: losingit
2 Replies

8. Web Development

Script to determine which web server at ip addresses

how do we determine if ip addresses are hosting IIS version 7.x or Apache 2.2.x. ? (3 Replies)
Discussion started by: NameSake
3 Replies

9. Shell Programming and Scripting

Script to determine server IP

Need help with the script, I am trying to include this script as part of kickstart profile. based of the host's IP address, in this case if the host is IP starting with 10.10.3.* or 10.10.6.*, I will be pushing appropriate routing file from my web server. I validate host IP from nslookup. ... (3 Replies)
Discussion started by: bobby320
3 Replies
DATEFMT_PARSE(3)							 1							  DATEFMT_PARSE(3)

IntlDateFormatter::parse - Parse string to a timestamp value

	Object oriented style

SYNOPSIS
public int IntlDateFormatter::parse (string $value, [int &$position]) DESCRIPTION
Procedural style int datefmt_parse (IntlDateFormatter $fmt, string $value, [int &$position]) Converts string $value to an incremental time value, starting at $parse_pos and consuming as much of the input value as possible. PARAMETERS
o $fmt - The formatter resource o $value - string to convert to a time o $position - Position at which to start the parsing in $value (zero-based). If no error occurs before $value is consumed, $parse_pos will contain -1 otherwise it will contain the position at which parsing ended (and the error occurred). This variable will contain the end position if the parse fails. If $parse_pos > strlen($value), the parse fails immediately. RETURN VALUES
timestamp parsed value, or FALSE if value can't be parsed. EXAMPLES
Example #1 OO example <?php $fmt = new IntlDateFormatter( 'en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo 'First parsed output is ' . $fmt->parse('Wednesday, December 20, 1989 4:00:00 PM PT'); $fmt = new IntlDateFormatter( 'de-DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); ?> Example #2 datefmt_parse(3) example <?php $fmt = datefmt_create( 'en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo 'First parsed output is ' . datefmt_parse($fmt, 'Wednesday, December 20, 1989 4:00:00 PM PT'); $fmt = datefmt_create( 'de-DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo 'Second parsed output is ' . datefmt_parse($fmt, 'Mittwoch, 20. Dezember 1989 16:00 Uhr GMT-08:00'); ? The above example will output: First parsed output is 630201600 Second parsed output is 630201600 SEE ALSO
datefmt_create(3), datefmt_format(3), datefmt_localtime(3), datefmt_get_error_code(3), datefmt_get_error_message(3). PHP Documentation Group DATEFMT_PARSE(3)
All times are GMT -4. The time now is 01:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy