![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plink connections to multiple unix servers | Moxy | Shell Programming and Scripting | 2 | 08-28-2008 10:42 PM |
| Accessing variables of one shell script in another shell script | looza | Shell Programming and Scripting | 2 | 06-30-2008 08:13 PM |
| How we can use plink? | shekhar_ssm | Shell Programming and Scripting | 0 | 03-16-2008 12:35 PM |
| How to pass a parameter from one Shell-script to another Shell-script | subodhbansal | Shell Programming and Scripting | 2 | 09-22-2007 06:19 AM |
| Plink problem....only works if passwd is in the script | Yinzer955i | UNIX for Dummies Questions & Answers | 3 | 08-29-2006 02:56 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
This is my shell script... test.sh
DIRECTORY=/XYZ/PQR if [ -f $DIRECTORY/TTT/* ]; then echo "In test.." else echo "lno.." fi when i run this script through a putty its output is: ./test.sh: line 2: [: too many arguments lno.. But when i run the same script using plink its running fine and its output is as expected... wanted to know why this is happening... |
|
|||||
|
There's no reason why a session invoked through putty should behave differently to one invoked through plink. That's very odd...
But as cfajohnson says, using [ -f * ] is generally something to avoid. What are you actually trying to test for? |
|
||||
|
plink and shell script
if i add the interperet explicitly then its working fine..
#!/bin/sh DIRECTORY=/XYZ/PQR if [ -f $DIRECTORY/TTT/* ]; then echo "In test.." else echo "lno.." fi This works fine..are these shell dependent?i am using bash shell.. |
|
|||||
|
Quote:
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|