Securing arguments


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Securing arguments
# 1  
Old 05-21-2004
Tools Securing arguments

OK here is my problem. Ive been trying to write a script where i use the order "find".

For example if i wont to find some file in the sql_work directory using the script. You use the command: loc sql_work "q*" in order to find all the queries in the directory.
Is there any other way to do it, like for example: loc sql_work q* without using the " " which secure the argument from the shell?

Here is the script:

#! /bin/csh
if($#argv == 0) then
echo Usage is $0 path filename
echo or $0 filename
exit 1
endif
if($#argv == 1) then
foreach arg($argv)
set tmp = `find ~ -name "$arg"` >& /dev/null
if("$tmp" != "") then
echo $tmp
else
echo No files matching name "$argv[1]"
exit 1
endif
end
exit 0
endif
if($#argv == 2) then
if(! -e "$argv[1]") then
echo "$argv[1]" not valid directory
exit 2
endif
set tmp = `find ~/"$argv[1]" -name "$argv[2]"` >& /dev/null
if("$tmp" != "") then
echo $tmp
else
echo No files matching name "$argv[2]"
exit 1
endif
exit 0

endif



Thank you in advance!!!Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. AIX

Securing AIX

Guys, i want to securing AIX after install by scratch. Is anybody can inform about the standard port which used by AIX? (4 Replies)
Discussion started by: michlix
4 Replies

2. Cybersecurity

securing AIX box

Guys, i want to securing AIX after install by scrath. Is anybody can inform about the standard port which used by AIX? (0 Replies)
Discussion started by: michlix
0 Replies

3. Linux

Securing remote connections

Hi all, I have a couple of questions I've been searching on internet but I didn't find a suitable solution. The aim is that I'd like to access to my home Linux (an 8.04 Ubuntu) from outside. I already achieved with ssh, but I'd like to secure as much as I can. These are questions: The... (2 Replies)
Discussion started by: AlbertGM
2 Replies

4. Cybersecurity

Securing Passwords

Hi All, I'd like to give you an example of what I am trying to achieve and perhaps you might be able to help me along. I would like to add the following criteria to new servers, from a password aging and lockout standpoint. -Number of failed logins before lockout: = 5 -Number of Passwords... (1 Reply)
Discussion started by: mkono
1 Replies

5. AIX

securing a shell

I would like to secure a shell script from being broken out of with Ctrl-C or equivalent. Once a user logs in, he should not be able to exit to the command prompt. any ideas. Thank you J (1 Reply)
Discussion started by: jhansrod
1 Replies

6. Cybersecurity

securing a remote box

someone has access to my server... I've got a solaris 7 box with remote access only. many of the services don't have passwords and someone recently messed with the shadow file -the root: line was changed: . password field was changed to NP . the number after that was changed too The... (8 Replies)
Discussion started by: sphiengollie
8 Replies
Login or Register to Ask a Question