Sponsored Content
Top Forums Shell Programming and Scripting Problem with getting shell script to look two levels down... Post 302418205 by mojoman on Monday 3rd of May 2010 01:28:09 PM
Old 05-03-2010
Problem with getting shell script to look two levels down...

Hi,

I am writing a shell script and I need to make sure files exist two levels below a current directory so I use the following conditional check:

Code:
if [ '/var/spool/postfix/deferred/\*/\*' ]

The way the script seems to be working is that if something exists at the first level is executes the script. I only want it to execute if it is two levels below.

How can I go about doing this?

Last edited by mojoman; 05-03-2010 at 02:53 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem In Shell Script

Hi, I'm new to Shell script. Can anyone tell me where is the wrong in my code? And, my code is -- echo "Enter Start Date(YYYY-MM-DD): " read stdt echo "Enter End Date(YYYY-MM-DD): " read endt echo "Enter Flight Number(Optional): " read fln (11 Replies)
Discussion started by: satyakide
11 Replies

2. Shell Programming and Scripting

problem in shell script

I am bit new to shell scripting. Is there any body who can help me There are n number of files present in folder named like (/girish/1) ),(/girish/2) .....so on, till (/girish/24) folder. I have to delete all the file from all these folders. I have to pass '/girish' path from the file name... (5 Replies)
Discussion started by: girish.batra
5 Replies

3. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

4. Shell Programming and Scripting

C-Shell Script Problem

I am trying to write a simple script to update clients that are probes with new software, but everytime I run it, it doesn't wait for the download it just runs through the list of clients without finishing the download. I tried to use wait on the pid and I could use sleep for some crazy amount of... (0 Replies)
Discussion started by: gbxfan
0 Replies

5. Shell Programming and Scripting

shell script , $$ problem

dialog --title "Inputbox - To take input from you" --backtitle "Linux Shell\ Script Tutorial" --inputbox "Enter your name please" 8 60 2>/tmp/input.$$ sel=$? na=`cat /tmp/input.$$` case $sel in 0) echo "Hello $na" ;; 1) echo "Cancel is Press" ;; 255) echo " key pressed" ;; ... (7 Replies)
Discussion started by: cola
7 Replies

6. Shell Programming and Scripting

Shell script problem

Hello. I am trying to make this shell script bellow work on my server wich should take the names in newacc.cvs and add them to the system. For each user the script should ask me to enter a password for the user im adding and then add them to the system, however my current solution do not work atm... (7 Replies)
Discussion started by: ryzzaze
7 Replies

7. Shell Programming and Scripting

Shell script problem

i have a set of commands to be executed, which is working perfectly when executed from terminal line by line but when its put in a shell script its not working i.e its giving FileNotFoundException. how do i resolve it my code is like #!/bin/sh pushd /Desktop/Solris_Installer/ROCore jar xf... (4 Replies)
Discussion started by: divyakprabh
4 Replies

8. Shell Programming and Scripting

Problem in shell script

hi...i create a script which reads data from file and compare that the data which is entered by me through keyboard...i can easily read first two contents of file..i am facing the problem to read other contents.. structure of my file is username:password:username1:password1.......and so on ... (1 Reply)
Discussion started by: shubhig15
1 Replies

9. Shell Programming and Scripting

problem in shell script

hi every body this is my first thread in this forum, i hope find a solution for my problem i have to write a script bt i still have some error and i don't know how to correct them $ for i in `seq 500 505`; do ./generateur_tache $i tache$i.txt; nprocs=$i; copt$i=`cat tache$i.txt | ./copt.awk` ;... (10 Replies)
Discussion started by: ordo_ordo
10 Replies

10. Shell Programming and Scripting

Shell script newbie, what is problem with my script?

Hello, Ubuntu server 11.10 can anybody help what is problem with my shell script? #!/bin/bash #script to find out currently logged on user is root or not. if ] then echo "You are super" else echo "You are awesome!" fi When I run script, I get following output ./uid: line 3: I... (4 Replies)
Discussion started by: kaustubh
4 Replies
script(1)						      General Commands Manual							 script(1)

NAME
script - Makes a transcript of terminal session SYNOPSIS
script [-a] [file] The script command makes a transcript of everything printed on your terminal. OPTIONS
Appends the transcript to file rather than writing it to file. OPERANDS
The name of an output file that will contain the transcript of the session. If this parameter is omitted, the file typescript is written. DESCRIPTION
The transcript is written to file, or appended to file if the -a option is given. If no file name is given, the transcript is saved in the file typescript. The script ends when the forked shell exits. This program is useful when you are using a CRT and want a hard-copy record of the dialog (for example, a technical writer might create an example of a working session this way). If you specify the -a option and the file does not exist, it is created. If you do not specify the -a option and the file exists, it is replaced. RESTRICTIONS
The script command requires a streams based terminal. In single user mode, streams may not be enabled. Under these circumstances, script will exit with no action. If you are the superuser and need to run this command in single user mode, use the following special instruc- tions. Enabling Streams If it is necessary to enable a streams environment in the single user mode, enter the command /sbin/init.d/streams. This command is avail- able to the superuser only. SEE ALSO
Commands: autopush(8), cat(1), echo(1), strsetup(8), tee(1) System Administration script(1)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy