Sponsored Content
Top Forums Shell Programming and Scripting Search and open a folder and file Post 303001480 by sbrady on Friday 4th of August 2017 10:36:33 AM
Old 08-04-2017
Search and open a folder and file

here is the path on Macintosh:
Macintosh HD/Users/shawn/Desktop/ATP/ATP14 bon bon/ATP14 bon bon.jpg
  1. I need to find the folder with ATP14 in the name, then open the folder
  2. I need to find the file whose name starts with ATP14 in the folder in 1 above


I had been using this in Applescript but its not working now. Would grep command work?

thanks for any help


set text_returned to "ATP14"
set the_producer_initials to "ATP"

do shell script ls -d '/volumes/Macintosh HD/Users/shawn/Desktop/ATP/'*' ' & the_producer_initials's quoted form & "/" & text_returned's quoted form & "' '*"

Last edited by rbatte1; 08-07-2017 at 08:35 AM.. Reason: Converted textual numbered lists to formatted numbered lists with LIST=1 tags. Added ICODE tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse the .txt file for folder name and FTP to the corrsponding folder.

Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies

2. Shell Programming and Scripting

Search for a File Name in a folder

Hello All, Can you please help me with this request. I have to identify a file (having file name with perticular pattern) with in a range. Example: input file name can be: myfile2007_03 myfile2007_45 myfile2007_198 myfile2007_25 myfile2007_101 my program has to identify... (1 Reply)
Discussion started by: sbasetty
1 Replies

3. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

4. Red Hat

GUI help requir Every folder open in new Window..

I am using GUI mode in Linux & face a problem that when ever i double click on any folder it opens in new Window. I want to ask all DP members where is the option to disable this thing.. Means i want when ever i double on folder it should open in the same Window. looking for your help.. (1 Reply)
Discussion started by: salman103
1 Replies

5. Shell Programming and Scripting

Search through subfolders and move them into separate folder on the base of file size

Hello guys I am sure that you will help me on this issue as you did earlier::) Scenario : I have a folder named "XYZ". It consist many sub-folders and subfolder contain severals files. there may be abc.dat in each subfolder. Now i want to seperate subfolders on follwing conditions- if abc.dat... (12 Replies)
Discussion started by: infiant
12 Replies

6. Shell Programming and Scripting

write shell script to search file in folder

hi .. i have a problem how to search file with date and version number(ms_2.0_dd/mm/yy_24)in folder.Here 24 is version number and compare the this file to other file which is in another folder and if does not match then copy this file to respective folder.Also copy different files in different... (1 Reply)
Discussion started by: shubhig15
1 Replies

7. Shell Programming and Scripting

Search in folder and subfolders

How can this be done? I mean, I want to search for all *png *jpg *bmp files in my ~/Pictures/ folder....How can I list them? Thank you geeks :) :b: (2 Replies)
Discussion started by: hakermania
2 Replies

8. Shell Programming and Scripting

Need to build Shell Script to search content of a text file into a folder consist several files

Have to read one file say sourcefile containing several words and having another folder containing several files. Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies

9. Shell Programming and Scripting

Open a folder

this works, it opens a project folder within a category folder: set y to (do shell script "open '/volumes/Features1/" & the_cat & "/" & UpperCase & " '*") this will not simply open the category folder: set y to (do shell script "open '/volumes/Features1/" & the_cat & "/") any ideas, I am... (0 Replies)
Discussion started by: sbrady
0 Replies

10. Ubuntu

Open in folder feature

My Ubuntu 16.04 OS has a neat feature. If I search for a specific file when it finds the file I can right-click it and select 'Open in folder'. However, I recently installed 12.04 (yes I know its EOL) and I noticed it doesn't seem to have this feature. Does anyone know if it is possible for me to... (3 Replies)
Discussion started by: Circuits
3 Replies
RMF(1)								     [nmh-1.5]								    RMF(1)

NAME
rmf - remove an nmh folder SYNOPSIS
rmf [+folder] [-interactive | -nointeractive] [-version] [-help] DESCRIPTION
Rmf removes all of the messages (files) within the specified (or default) folder, and then removes the folder (directory) itself. If there are any files within the folder which are not a part of nmh, they will not be removed, and an error will be produced. If the folder is given explicitly or the -nointeractive option is given, then the folder will be removed without confirmation. Otherwise, the user will be asked for confirmation. If rmf can't find the current folder, for some reason, the folder to be removed defaults to `+inbox' (unless overridden by user's profile entry "Inbox") with confirmation. If the folder being removed is a subfolder, the parent folder will become the new current folder, and rmf will produce a message telling the user this has happened. This provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list and returning to the current folder from which the list was extracted. If rmf s used on a read-only folder, it will delete all the (private) sequences (i.e., "atr-seq-folder" entries) for this folder from your context without affecting the folder itself. Rmf irreversibly deletes messages that don't have other links, so use it with caution. FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder Inbox: To find the default inbox SEE ALSO
rmm(1) DEFAULTS
`+folder' defaults to the current folder, usually with confirmation `-interactive' if +folder' not given, `-nointeractive' otherwise CONTEXT
Rmf will set the current folder to the parent folder if a subfolder is removed; or if the current folder is removed, it will make "inbox" current. Otherwise, it doesn't change the current folder or message. BUGS
Although intuitively one would suspect that rmf works recursively, it does not. Hence if you have a sub-folder within a folder, in order to rmf the parent, you must first rmf each of the children. MH.6.8 11 June 2012 RMF(1)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy