nixCraft Linux / UNIX / Shell Scripting Forum

nixCraft

Linux / UNIX Tech Support Forum

if csh false command syntax

This is a discussion on if csh false command syntax within the Shell scripting forums, part of the Development/Scripting category; i try code but it is not working, can you give me syntax? Code: if [ -f myfile ] then ...


Register free or login to your account to remove all advertisements.

Go Back   nixCraft Linux / UNIX / Shell Scripting Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

Thread Tools Display Modes
  #1 (permalink)  
Old 10th March 2010, 05:06 PM
Member
 
Join Date: Jul 2009
OS: Fedora linix
Scripting language: Linux bash
Posts: 70
Thanks: 40
Thanked 0 Times in 0 Posts
Rep Power: 2
chinalinix is on a distinguished road
Default if csh false command syntax

i try code but it is not working, can you give me syntax?
Code:
 if [ -f myfile ]
 then
   printf "myfile already found\n"
 fi
what wrong with my code?
Reply With Quote
  #2 (permalink)  
Old 10th March 2010, 05:11 PM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,195
Thanks: 13
Thanked 394 Times in 292 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

Try
Code:
if ( -e /path/to/file ) echo "file found"
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
[Solved] Drupal Syntax highlighter Escaping Angel Brackets html < > jaysunn Coding in General 4 7th February 2010 02:30 PM
[Solved] .bash_profile error syntax error: unexpected end of file shoboy Shell scripting 6 3rd February 2010 09:49 AM
syntax error asim.mcp Shell scripting 3 13th December 2009 07:17 PM
SQL Syntax ERROR - C# eawedat Databases servers 7 2nd October 2009 07:36 PM
syntax for mail pansarevai Shell scripting 2 12th February 2008 02:13 AM


All times are GMT +5.5. The time now is 09:00 PM.


Powered by vBulletin® Version 3.8.6 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40