get absolute filename


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting get absolute filename
# 1  
Old 08-21-2007
get absolute filename

How would I get the absolute filename of a selected file...I want to control click...I already have the context menu all set to run a script...I just need to be able to get the file name of the file I control clicked on.

In windows it is as follows:
set filename=%~f1
set name=%~n1
set extention=%%~xa

Then to call it %filename% or %name% or %extention%.

Is there the same thing for a Mac shell script?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My code: if then set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\ "pam_account"; for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

2. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

3. Shell Programming and Scripting

Split Filename from Absolute Path

Hello, I have the string "/a/b/c/ddd.txt" and i want to get only the filename, in this case "ddd.txt". I have as something known in the script the pattern "/a/b/c/", so I`ve tried something like: echo "/a/b/c/ddd.txt" | cut -d "/a/b/c/" -f2 but it doesn`t go, any help?. thanks, bye (2 Replies)
Discussion started by: rubber08
2 Replies

4. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

5. Windows & DOS: Issues & Discussions

get filename from absolute path in batch program

hey im writing batch program for the first time and i have almost finished it the only problem is that i want to extract basename from absolute path for eg : if my first argument is c:\abcd\xyz\temp.txt then i want only temp.txt in variable. and how do i extract some part from string for eg... (1 Reply)
Discussion started by: zedex
1 Replies

6. UNIX for Dummies Questions & Answers

absolute value

is there any function in unix which will convert a integer to absolute value with a single decimal point. suppose x=15232 y=x/1024=14.875 i want y to be 14.8 Similarly if y=6.29452 it should come as 6.3 (3 Replies)
Discussion started by: dr46014
3 Replies

7. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

8. Shell Programming and Scripting

Absolute value

Is there a function in awk to get the absolute value of a-b which can be negative or positive, I just care for the absolute value... (5 Replies)
Discussion started by: placroix1
5 Replies

9. UNIX for Dummies Questions & Answers

absolute path

is cd ~ considered an absolute path? (2 Replies)
Discussion started by: Kirichiko
2 Replies

10. UNIX for Dummies Questions & Answers

Getting absolute value ksh

Hi, I am trying to find out how to get an absolute value for integer in ksh. I tried using abs... but that doesn't work ! this is the workaround I did, but isn't there an inbuilt function to get absolute value for any variable ! Please help as i am new to unix :confused: Thanks, ... (3 Replies)
Discussion started by: icyhot
3 Replies
Login or Register to Ask a Question
modload(1M)                                               System Administration Commands                                               modload(1M)

NAME
modload - load a kernel module SYNOPSIS
modload [-p] [-e exec_file] filename DESCRIPTION
The modload command loads the loadable module filename into the running system. filename is an object file produced by ld -r. If filename is an absolute pathname then the file specified by that absolute path is loaded. If filename does not begin with a slash (/), then the path to load filename is relative to the current directory unless the -p option is specified. The kernel's modpath variable can be set using the /etc/system file. The default value of the kernel's modpath variable is set to the path where the operating system was loaded. Typically this is /kernel /usr/kernel. For example, the following command looks for ./drv/foo: example# modload drv/foo The following command looks for /kernel/drv/foo and then /usr/kernel/drv/foo: example# modload -p drv/foo OPTIONS
The following options are supported: -e exec_file Specify the name of a shell script or executable image file that is executed after the module is successfully loaded. The first argument passed is the module ID (in decimal). The other argument is module specific. The module specific information is: the block and character major numbers for drivers, the system call number for system calls, or, for other module types, the index into the appropriate kernel table. See modinfo(1M) -p Use the kernel's internal modpath variable as the search path for the module. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ld(1), add_drv(1M), kernel(1M), modinfo(1M), modunload(1M), system(4), attributes(5), modldrv(9S), modlinkage(9S), modlstrmod(9S), mod- ule_info(9S) Writing Device Drivers NOTES
Use add_drv(1M) to add device drivers, not modload. See Writing Device Drivers for procedures on adding device drivers. SunOS 5.10 1 Dec 1993 modload(1M)