Sponsored Content
Full Discussion: check if it's there
Top Forums Shell Programming and Scripting check if it's there Post 302476063 by ctsgnb on Tuesday 30th of November 2010 06:01:04 PM
Old 11-30-2010
Code:
kopie()
{
plaats="" ; naarwaar="" ; bestand=""
    echo -n " Plaats van waar: "
    read plaats
    echo -n " Geef de naam van het te kopiëren bestand : "
    read bestand
    echo -n " Directory naar waar : "
    read naarwaar
[[ ! -d "$plaats" || ! -d "$naarwaar" ]] && echo "Warning: $plaats or $naarwaar is not a directory"
[[ ! -r "$plaats/$bestand" ]] && echo "cannot read  $plaats/$bestand"
if [ -f "$plaats/$bestand" ]
    then
        echo "Bestand $bestand bestaat in $plaats"
        if [ -f "$naarwaar/$bestand" ]
        then
            echo " Bestand bestaat reeds in $naarwaar"
        else
            echo "$naarwaar bestaat niet, of $bestand staat reeds in $naarwaar"
        fi
    else
    echo "Bestand $bestand bestaat niet in $plaats, of de directory $plaats bestaat niet"
    echo -n "Kopiëren niet uitgevoerd"
    fi
}


Last edited by Scott; 12-01-2010 at 06:49 PM.. Reason: Code tags
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to check for a file, check for 2hrs. then quit

I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit. Logically, I'm looking for the best way to approach this Thanks for any assistance in advance. Note: I'm using a C shell and... (2 Replies)
Discussion started by: mmarsh
2 Replies

2. UNIX for Dummies Questions & Answers

is there any way to check if some ip is taken ?

hello is there any tool in unix that will indicate if some ip is already taken by other machine? (4 Replies)
Discussion started by: umen
4 Replies

3. Shell Programming and Scripting

check it

Can i write the following script... $sqlplus -s uname/password @connectingstring select emp_id,emp_name from employees > a.csv quit $mailx -s fga@ds.com < a.csv $ (2 Replies)
Discussion started by: anupdas
2 Replies

4. Shell Programming and Scripting

script to check if another script is running and if so, then sleep for sometime and check again

Hi, I am a unix newbie. I need to write a script to check wheteher another script is still running. If it is, then sleep for 30m and then check again if the script is running. If the script has stopped running then, I need to come out of the loop. I am using RHEL 5.2 (2 Replies)
Discussion started by: mathews
2 Replies

5. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

6. Shell Programming and Scripting

check in and check out comments

Hi Do you know how can I get all check in and check out comments for a period of time with Surround SCM CLI ---------- Post updated at 02:00 AM ---------- Previous update was at 01:56 AM ---------- Do you have NAnt tasks that allow us to access Evolution from an NAnt build script? (0 Replies)
Discussion started by: saku
0 Replies

7. Shell Programming and Scripting

Perl code to check date and check files in particular dir

Hi Experts, I am checking how to get day in Perl. If it is “Monday” I need to process…below is the pseudo code. Can you please prove the code for below condition. if (today=="Monday" ) { while (current_time LESS THAN 9:01 AM) ... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

8. Shell Programming and Scripting

Check

echo "2012-12-26--14.8224 2012-12-27--14.2898 2012-12-28--14.9180 2012-12-29--13.3637 2012-12-30--13.7091" the set of numbers i provided above is separated by spaces. how do i count how many sets there are? i tried: echo "2012-12-26--14.8224 2012-12-27--14.2898 2012-12-28--14.9180... (5 Replies)
Discussion started by: SkySmart
5 Replies
TREK(6) 							 BSD Games Manual							   TREK(6)

NAME
trek -- trekkie game SYNOPSIS
trek [[-a] file] DESCRIPTION
trek is a game of space glory and war. Below is a summary of commands. For complete documentation, see Trek by Eric Allman. If a filename is given, a log of the game is written onto that file. If the -a flag is given before the filename, that file is appended to, not truncated. The game will ask you what length game you would like. Valid responses are ``short'', ``medium'', and ``long''. You may also type ``restart'', which restarts a previously saved game. You will then be prompted for the skill, to which you must respond ``novice'', ``fair'', ``good'', ``expert'', ``commodore'', or ``impossible''. You should normally start out with a novice and work up. In general, throughout the game, if you forget what is appropriate the game will tell you what it expects if you just type in a question mark. AUTHOR
Eric Allman SEE ALSO
/usr/share/doc/bsdgames/trek.me COMMAND SUMMARY
abandon capture cloak up/down computer request; ... damages destruct dock help impulse course distance lrscan move course distance phasers automatic amount phasers manual amt1 course1 spread1 ... torpedo course [yes] angle/no ram course distance rest time shell shields up/down srscan [yes/ no] status terminate yes/no undock visual course warp warp_factor BSD
December 30, 1993 BSD
All times are GMT -4. The time now is 05:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy