Sponsored Content
Top Forums Shell Programming and Scripting How to get Find command work with a variable passing "*" value? Post 302085121 by tayyabq8 on Tuesday 15th of August 2006 10:07:39 AM
Old 08-15-2006
EDIT---
Updated to take care of "*", here is the code and sample use of the script:
Code:
admin@unix1:/home/admin/scripts$./find1 name "*.txt"
./test1/a.txt
./a.txt
./b.txt

Code:
admin@unix1:/home/admin/scripts$cat find1
### (script name = rmf.sh)
 #!/bin/ksh -x
 #$1 - name of option
 #$2 - pattern of filename or age of file
tmp=`echo "$2" | sed 's/\"//'`
if [ "$1" == "name" ]; then
    optn="-name"
else
    optn="-mtime"
fi
find . -type f $optn "$tmp" -print

Regards,
Tayyab

Last edited by tayyabq8; 08-15-2006 at 11:32 AM.. Reason: Updated to take "*" as argument
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing a list of dynamic names to a "PS" command in shell script?

Hi, I am new to shell script. This is my first post .I have written a small script which returns list of names starts with "ram" in /etc/passwd .Here is that:- #!/bin/ksh NAME_LIST="name_list.txt" cat /dev/null > $NAME_LIST evalcmd="cat /etc/passwd | grep "^ram?*" | cut -d: -f1" eval... (3 Replies)
Discussion started by: sachin.tendulka
3 Replies

2. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

3. Shell Programming and Scripting

passing the output of cmd from "eval" to a variable

Hello, I need help with the eval command. I have been building a lengthy cmd using eval, and I need to create $var from the output of the cmd. Here is what I have. Out=/dfezz1/output.txt Node="'LPAR Info:'" Gr3p0=" |grep" Printc=" prtconf" Output1=" 1>>$Out 0>&1" Cat1="cat... (8 Replies)
Discussion started by: dfezz1
8 Replies

4. Shell Programming and Scripting

store the output of "find" command in a variable?

I intend to find the path/full location of a file(filename given by user thru "read filenme") using "find" or any other command and then store it's output in a variable for some other processing. But struggling to put all things together (i.e finding the fully qualified location of that file and... (4 Replies)
Discussion started by: punitpa
4 Replies

5. OS X (Apple)

Neither "which" nor "find" commands work

hi there, could use some basic PATH advice, i think, or something find sometimes work, but which hasn't ever seemed to. for years! what am i doing wrong that the commands which and find rarely work? they used to work on the workstations i used ages ago... running 10.5.8 because i... (4 Replies)
Discussion started by: zensnob
4 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
shares-admin(1) 					      General Commands Manual						   shares-admin(1)

NAME
shares-admin - Shared Folders Administration Tool SYNOPSIS
shares-admin [OPTION...] DESCRIPTION
shares-admin is part of the GNOME system tools, a set of tools to easily access and manage system configuration. shares-admin allows you to share folders to other computers in your network or in the internet. OPTIONS
shares-admin accepts the standard GNOME and GTK options. AUTHORS
shares-admin was written by Carlos Garnacho Parro <garnacho@tuxerver.net> and others. This manual page was written by Sven Arvidsson <sa@whiz.se>, for the Debian project (but may be used by others). SEE ALSO
services-admin(1), network-admin(1), time-admin(1), users-admin(1), gtk-options(7), gnome-options(7) The online documentation available through the program's Help menu. GNOME
2007-05-08 shares-admin(1)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy