General :: Anything Syntactically To Pass Variable To Smbclient?

Feb 23, 2010

I am trying to pass a variable to smbclient (OS X), but the variable is recognized only as its strict text.

Is there anything syntactically I have to do pass a variable created in the shell (bash) to smbclient (or perhaps any other interactive app)? I've seen references to variables as $[variable] or ${variable} but I've not been able to figure out what works.

View 5 Replies


ADVERTISEMENT

General :: Pass A Variable From One Script To Another?

Nov 22, 2009

I want to pass a variable from one script to another, I have a feeling it's extremely simple.

I looked at exporting, but apparently that clogs up the shell, so I don't want to go down that route. Any suggestions?

View 2 Replies View Related

General :: Pass A Variable To A Function That Already Being Escaped?

Jul 28, 2010

What i want to do is create multiple informix sql statements & later run them via a bash script.

Here is what i have so far (this works) but is meant to be run from a cron job so it only does one day at a time:

echo "
update hst`date --date='yesterday' +%m%d%y`
set x = 'GARP'
where y in ('CRE', 'LAC', 'SRL', 'JAG', 'JNM', 'BIM')
and appl = '';

[Code].....

The problem here is it doesnt want to read the variable $x correctly so the statement fails.

View 1 Replies View Related

General :: Recalculate Variable For Each Pass Of An Until Loop?

Feb 11, 2010

I am trying to write a script that will find any user on the server running more than one instance of the epiphany web browser process, then kill all their epiphany pids. (This is necessary sometimes to cure lockups, and repeat processes are the telltale sign in this case). I have tried implementing the until loop:

Code:
USER=`ps aux | grep epiphany | grep -v grep | sort | uniq -d -w 5 | awk '{print $1}'`
until [[ "$USER" == "" ]]
do
ps aux | grep epiphany | grep -v grep | grep $USER | awk '{print $2}' | sudo xargs kill
done

Unfortunately, the script only calculates the USER variable once at the beginning of the script. Fair enough, that's how it's written. My question is, how would I get the USER variable to update for each pass of the until loop so that it could cure multiple users of this ailment if necessary? That is, calculate $USER, kill their epiphany pids, repeat those two steps until the $USER variable comes up blank, then exit.

View 5 Replies View Related

General :: Executing Binaries - Pass The Hostname As A Variable Or Read From A File?

May 2, 2010

I am looking for a clue in shell or ant script, where I excecute a binay file on linux. For example ./myfile.bin which ask me few questions.

./myfile.bin ...........................100%

I would like to automate this process where I want to pass the hostname as a variable or read from a file is it possible? If yes any sample`s on this. I can do if this was a shell script ($1) but not sure when its binary.

View 8 Replies View Related

Programming :: Pass Variable Between Scripts?

Mar 9, 2011

I need to pass variable from sc1.sh to sc2.sh and update the value of the passed variable in sc2.sh and then return the updated value of the variable from sc2.sh to sc1.sh.

View 7 Replies View Related

Ubuntu :: C++ - Can't Pass System Output To Variable ?

Sep 8, 2010

I have a line that looks something like this:

Code:

How do i put its output in a variable?

View 9 Replies View Related

Server :: Get Variable From Bash From Mysql Or Pass From Php?

Apr 26, 2010

I am not parsing on a webserver so is it possible to have both

#! /usr/bin/php &
#!/bin/bash

in the same script? Alternatively, I have a current bash script that I need to get some variables from mysql and not sure how to get mysql results in bash:

Quote:

mysql -h server.net -u username1 -paaa -e "USE squid; SELECT email, usern FROM TABLE WHERE blah blah;"
emailadd="resultfrom above"
usern="resultfromabove"

View 11 Replies View Related

Programming :: Pass A Path As A String To A Variable?

Apr 17, 2009

I'm trying to pass a path as a string to an array, but its evaluating it as a command instead. I want to take the literal string "/mnt/accounts/user/temp/*.jpg" and assign it to an array{1}, but when i echo the array variable, it displays it as

pic1.jpg
pic2.jpg
pic3.jpg

[code]....

I just want it to be the actual text "/mnt/accounts/user/temp/*.jpg" which i will be combining with other text to create a longer path elsewhere in the code.

View 5 Replies View Related

Programming :: How To Pass Sed Address By Shell Variable

Aug 2, 2011

Code...

I am somewhat confident that there is a neater way.

Question: Does anybody know the answer?

View 3 Replies View Related

Programming :: Pass A Shell Variable To An AWK Command?

Dec 23, 2010

I have the following code :

Code:
E_BADARGS=65
if [ $# -ne 2 ] ; then

[code]...

View 1 Replies View Related

Programming :: Pass Variable From One Shell Script Into Another

Oct 2, 2009

I have some messy code that I wrote a while back and I am trying to organize it. The program opens xpaint and uses xwit and xte to draw packman and so on. I want to split it all up I am going to add more to it. Basically like i would want drawing packman in one function i guess you could call it and then coloring him or the background in another

<code>
#!/bin/bash
pkill xpaint
res=`xwininfo -root | grep geom | sed -e 's/^.*try ([0-9][0-9]*x[0-9][0-9]*)+.*$/1/'`
Xoriginal=`echo $res | cut -d 'x' -f 1`
Yoriginal=`echo $res | cut -d 'x' -f 2`

X=`echo "($Xoriginal/2)-400" | bc `
Y=`echo "$Yoriginal/2" | bc `
#t=$(($Y/2))
bob=`echo "$Y/2" |bc `
echo $X
echo $Y

/usr/bin/xpaint -size "$Xoriginal"x"$Yoriginal" -popped &
sleep 4
paintersMom=`xwit -all -print | grep XP | cut -d ":" -f 1`
canvasWin=`xwit -all -print | grep Untitled | cut -d ":" -f 1`
#toolres=`xwininfo -id $paintersmom | grep geom | sed -e 's/^.*try ([0-9][0-9]*x[0-9][0-9]*)+.*$/1/'`
#canres=`xwininfo -id $canvasWin | grep geom | sed -e 's/^.*try ([0-9][0-9]*x[0-9][0-9]*)+.*$/1/'`

#echo $paintersMom
xwit -id $paintersMom -move 0 0
xwit -id $canvasWin -move 0 0
xwit -root -warp "$X" "$Y"
sleep 4
for((i=45; i < 315; i++))
do
xte 'mousedown 1'
ang=`./deg2rad $i`

movex=`echo "$X+$bob*c($ang)" | bc -l`
movey=`echo "$Y+$bob*s($ang)" | bc -l`
xwit -root -warp "$movex" "$movey"
done
xwit -root -warp "$X" "$Y"
xte 'mouseup 1'

#xwit -id $paintersMom -focus -raise
#sleep 1
#xwit -id $paintersMom -warp 30 390 #// fill in command on tool bar
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -id $canvasWin -warp 221 40 #// color selection
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -id $canvasWin -warp "$(($X-150))" "$Y" #//location on pac man
#sleep 1
#xte 'mouseclick 1'
#sleep 1

#xwit -id $canvasWin -warp 62 44 #// selecting color black
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -root -warp 62 120 #// selecting back to canvas
#sleep 1
#xte 'mouseclick 1' #// color canvas black
#sleep 1
#xwit -id $paintersMom -focus -raise
#xwit -id $paintersMom -warp 27 108 #//click back to pencil
#sleep 1
#xte 'mouseclick 1'
#sleep 1
</code>

Here for example $paintersmom is would be in the drawing of pacman but I would also want to use it when I colored him in.. but I would want both processes in a different shell script.

View 15 Replies View Related

Programming :: Pass _server Variable To Html?

Dec 20, 2010

This is a section on a php file running within a a Joomla module. I have the following code:

Code:
<?php echo '</div>'; ?>
<html>

[code]....

View 2 Replies View Related

Programming :: Pass An Expect Command Result Into A Variable And Then Use It Again?

May 4, 2010

I'm trying to create a program that would locate the oldest file of a certain type on a server. Here's the commands:

OLDEST_PATH=`find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1`
OLDEST_FILE=`find -L $OLDEST_PATH | grep .mp3 | sort -f | head -1`
ls -al $OLDEST_FILE

I'm writing this all in expect but I'm having problems. The main problem I have is whenever I try to run the first command, I can't seem to isolate the result of the OLDEST_PATH so that the 2nd command will work. There always seems to be a newline in the variable and the result is only "find -L" command running and it bypasses the variable. If I can just figure out how to get the 1st and 2nd command to work, then I can figure out the 3rd. Here's some code:

Code:
send "find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1
"
sleep 20
expect -re "(.*)

[Code]....

I know there is a better way to write this. I've tried multiple ways and this just happens to be the last way I've tried it. If you try running this, you'll notice that there is still carriage returns after the result of OLDEST_PATH and it prevents the 2nd "find" command from working properly.

View 2 Replies View Related

Programming :: Python : Pass Output Of System Commands To Variable?

Jan 25, 2011

I'm trying to write a python script that will use the current user's name when interacting. Ex: when started, it should say "hello daweefolk" when I am logged in.
I've tried
Code:
username=os.system("echo $USER")
but the variable remains empty.
What is the correct code?

View 1 Replies View Related

Programming :: Pass Variable In Mysql Qyery In C Programming?

Dec 4, 2010

i want to pass variable in mysql qyery in c programming

View 1 Replies View Related

General :: Way To Cp Directories Using Smbclient

Nov 25, 2009

Is there a way to cp directories using smbclient ?

View 3 Replies View Related

General :: Copying Files Using Smbclient?

Jun 7, 2010

I have a new network attached storage unit that I'm trying to transfer my data to. On this NAS, it has a very basic linux installed with SSH enabled. Browsing through the programs installed on it, i found smbclient. Am I able to copy files directly from my old NAS to my new one using smbclient?It would sure beat transfering 950GB from my old NAS through a computer then onto my new NAS.

View 1 Replies View Related

General :: Command For Smbclient With No Password?

Jun 25, 2011

I have a samba server setup it works fine for the users with their username and passwords. by executing the following command.

smbclient //fedora.com/one -U bigbob

it prompts password . If i give password i got

smb>

my question is that how can i login if the users doesn't have their passwords(public share) ?.. I mean smbclient command !!

View 1 Replies View Related

General :: Connecting To Windows 7 Share Via SMBClient

Apr 4, 2010

I am trying to allow my mother's Acer Aspire One (OS: Linpus Linnux Lite) to print on the WIFI Canon Pixma MP620 printer. The rest of the computers connected in the house run some variant of Windows. The printer has been set up to print wirelessly from the Windows computer. Having searched the internet for hours, I have determined that there aren't any drivers for that particular printer.

My potential solutions are:
1. Buy a new printer
2. Install Windows on the Aspire One (Last resort!)
3. Use this piece of software (http://www.printeranywhere.com/), which is installed on my Windows 7 computer which is on 90% of the time, and find some way to install it on Linux. (I tried Wine, and it opened up the installation .exe but when it came to actually installing, returned an error saying it needed to be installed on the same drive. :S)
4. Follow this tutorial (http://justin.yackoski.name/winp/) to print via my computer.

I think I will manage to follow the tutorial fine (as a complete Linux novice!), but I am having some problem with simply connecting to my Windows share folder, which I came across on this line of the tutorial: Test that you can access the share from the linux PC via smbclient. I.e., run: smbclient //windows_pc/spool -U print and make sure you can put a file into that shared directory. After I enter the password, as prompted, is returns:

session setup failed: SUCCESS - 0

When I try: "smbclient -L //WILL-PC -U Will", and then enter my password as prompted, it returns the same error. However if I try: "smbclient -L //WILL-PC -N", it returns: Anonymous login successful. Then my correct Domain, OS and server details. Then the titles: Sharename, Type and Comment

And then the following:
cli_rpc_pipe_open: cli_nt_create failed on pipe srvsvc to machine WILL-PC. Error was NT_STATUS_ACCESS_DENIED
Error returning browse list: NT_STATUS_ACCESS_DENIED
Anonymous login successful
Then the same correct Domain, OS and server details
Then two headings: Server and Comment, each of which have a different entry below them to do with my printer.
Then the two headings: Workgroup and Master, below which there are two different workgroups that we have, and my computer and my sisters laptop.

View 14 Replies View Related

General :: Smbclient Check File Modified Before 'get'

Oct 28, 2010

I checked the smbclient man but could not find any switch to us in combination with 'get' to check if the file has been modified before download.

View 1 Replies View Related

General :: Windows SMBClient - How To Share Folder

Jun 5, 2011

In this tutorial I have shown how we can share a folder from Windows to Linux, [URL]. The author of the video is not responsible if something is broken.

View 3 Replies View Related

General :: Getting Session Request Failed Whenever Send The Message Using Smbclient?

Nov 25, 2009

I am sending message from linux to windows system as follows echo "test"|smbclient -M <IP Add>But I am getting "session request failed" message . How can I solve it? <Ip Add> in network and reachable.

View 1 Replies View Related

General :: Assign Local Variable Values To Global Variable?

Feb 17, 2011

how to assign a local variable value to a global variable....

View 2 Replies View Related

General :: Create An Environment Variable With The PRINTER Variable?

Apr 16, 2011

I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)

View 3 Replies View Related

General :: Use The Value Of One Variable To Generate A Name For Another Variable?

Jul 25, 2010

can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example

objectnames1=`ls -a`
objectnames2=`ls -a`
etc.

i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.

if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...

View 6 Replies View Related

General :: Sed Substitution Of Variable With A Variable?

Dec 27, 2010

I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?

#!/bin/bash
# Script to alter position of residue number in pdb file for resid above 999
i=$(awk '{print $5}' wt-test.pdb | uniq)

[code]...

View 6 Replies View Related

Fedora :: Log Into The Samba Server From Smbclient?

Jan 18, 2010

i'm trying to log into the samba server from smbclient but i'm still having this error message:

[root@gab gab]# smbclient -L alain
Enter gab's password:
Connection to alain failed (Error NT_STATUS_CONNECTION_REFUSED)
[root@gab gab]#

View 1 Replies View Related

Fedora :: SMBClient : Command Not Found?

Jun 1, 2010

I've installed the latest Fedora 13 flavour, yum update completed, yum install samba -y

all installed fine.

yum list grep samba shows samba-13 installed however when type smbclient as root it returns

"Command Not Found" and returns me to bash.

yum remove samba
reboot
yum install samba
still nothing

smb[tab] returns : smbd, smbusers and 3 others but none that are smbc*. I'm kinda stuck for my windows shares at this point.

smbd i presumed was the deamon so i triggered that but smbclient still cant be found and when i ran smb(something) status it stated that the samba service was up and running.

users list is configured but i believe this is an issue with the command.

View 3 Replies View Related

CentOS 5 :: Smbclient Can't Overwrite Files?

Jun 17, 2010

I'm using CentOS 5.5 with smbclient 3.0.33-3.28-el5 (latest version in repo), and I can't overwrite files in my smb store.The CentOS box is merely a client of the smb share,and I am not the admin for the Windows server that hosts the share, so there isn't anything I can do server side. But I do have write permission to the server. I'm 95% certain that the server runs Windows Server 2003.I can create a new file,but if I need to overwrite it I need to delete the file, and then copy the new version over.My Windows XP machine can overwrite files perfectly fine.

Using the cp command I'll get this error: (/mnt/storage/foo.txt already exists)
[jonescb@localhost ~]$ cp foo.txt /mnt/storage/foo.txt
cp: cannot create regular file `/mnt/storage/foo.txt': No such file or directory`

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved