LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-22-2006, 04:20 AM   #1
Yasir Sualeh
LQ Newbie
 
Registered: Dec 2006
Posts: 1

Rep: Reputation: 0
error using samba


writing a shell scipt on bash:

[ysm@edb ~]$ vi smb.sh
# Verify Availability
#WINHOST=YasirSualeh
#CONNECT=$(echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M $WINHOST)


if echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M YasirSualeh | grep -q "Connected"
then
echo "Well connected."
else
echo "Oops, Not Connected."
fi



it works well if there is a hard code server name (see if condition)
but once i add a variable(WINHOST) in place of server name it does not send message. any hint?
 
Old 12-22-2006, 07:25 AM   #2
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Rep: Reputation: 31
Quote:
Originally Posted by Yasir Sualeh
writing a shell scipt on bash:

[ysm@edb ~]$ vi smb.sh
# Verify Availability
#WINHOST=YasirSualeh
#CONNECT=$(echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M $WINHOST)


if echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M YasirSualeh | grep -q "Connected"
then
echo "Well connected."
else
echo "Oops, Not Connected."
fi



it works well if there is a hard code server name (see if condition)
but once i add a variable(WINHOST) in place of server name it does not send message. any hint?
Maybe use backticks to expand the variable?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba Error bobbasic2002 Linux - General 2 04-11-2006 06:17 AM
Samba OS X to Linux Samba file share error ttoomey Linux - Software 1 08-16-2005 10:12 AM
Samba Error turishi007 Linux - Software 3 06-15-2004 11:01 AM
Samba error cyrilbritto Linux - Networking 3 10-13-2003 08:53 AM
Samba Error IHawk Linux - Networking 1 02-21-2002 08:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration