Hi,
I am new to this world of shell programming. I am facing a problem that is :
I have directory which has many sub directories at different depth. say
A/B/C/files
A/B/files
A/B/C/D/files
In this directory structure there exists a file called ".project" in some of the sub... (2 Replies)
Hi all,
I am learning the use of regular expression and I would like to know which regex can be used to select only the last part of a directory path name.
Something like:
/dir1/dir2/dir2
and I want to select the last /dir2 where dir2 can be any kind of string.
Thanks a lot for your help.... (7 Replies)
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Hi,
How can I display only one shortest path (A/B/configure)?
$ grep configure file.txt
A/B/configure
A/B/C/configure
A/B/C/D/configure
Thank you. (9 Replies)
I have run one file.but this file is two different directory is there.I wrote the if loop but one directory to find it the file and another directory is not find.
#!bin/bash
a=/tmp
mau="manual.sh"
if
then
echo `ls -l $mau`
else
echo "file not there"
b=/scr #not find the directory... (1 Reply)
My input is as below :
/splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt
/splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt
/splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt
/splunk/scrubbed/triumph/ifind.triumph.txt
From the above input I want to extract the file names only .
Basically I want to... (5 Replies)
I am using bash to prompt a user for a choice using: where a "y" response opens a menu with available panels that can be used.
while true; do
read -p "Do you want to get coverage of a specific panel?" yn
case $yn in
* ) menu; break;;
* ) exit;;
* ) echo... (6 Replies)
I am trying to select a file in bash and save it to a directory. The below does run but no selected file is saved. Thank you :).
bash
# select file
printf "please select a file to analyze with entered gene or genes \n"
select file in $(cd... (4 Replies)
Hello,
I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
LEARN ABOUT MOJAVE
tk_choosedirectory
tk_chooseDirectory(n) Tk Built-In Commands tk_chooseDirectory(n)
__________________________________________________________________________________________________________________________________________________NAME
tk_chooseDirectory - pops up a dialog box for the user to select a directory.
SYNOPSIS
tk_chooseDirectory ?option value ...?
_________________________________________________________________DESCRIPTION
The procedure tk_chooseDirectory pops up a dialog box for the user to select a directory. The following option-value pairs are possible as
command line arguments:
-initialdir dirname
Specifies that the directories in directory should be displayed when the dialog pops up. If this parameter is not specified, then
the directories in the current working directory are displayed. If the parameter specifies a relative path, the return value will
convert the relative path to an absolute path.
-mustexist boolean
Specifies whether the user may specify non-existent directories. If this parameter is true, then the user may only select directo-
ries that already exist. The default value is false.
-parent window
Makes window the logical parent of the dialog. The dialog is displayed on top of its parent window. On Mac OS X, this turns the file
dialog into a sheet attached to the parent window.
-title titleString
Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be dis-
played.
EXAMPLE
set dir [tk_chooseDirectory
-initialdir ~ -title "Choose a directory"]
if {$dir eq ""} {
label .l -text "No directory selected"
} else {
label .l -text "Selected $dir"
}
SEE ALSO
tk_getOpenFile(n), tk_getSaveFile(n)
KEYWORDS
directory, selection, dialog, platform-specific
Tk 8.3 tk_chooseDirectory(n)