Store command in a Var problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Store command in a Var problem
# 1  
Old 01-29-2009
Store command in a Var problem

Hi!

I strated to script since 1 month and I don't have much expirience but this thing here is strange

I have a script where I want to store a svn command in a var to check it later
so it's like this
Code:
#!/bin/sh
list=`ssh itadmin@192.168.1.200 "ls /home/svn"` # this stores the list of repositories and works fine
projname=`zenity --entry --text "$list

Enter the project name that you want to create "` # this ask to the user to insert the name of the project according to the list and works fine
version= `ssh itadmin@192.168.1.200 "svnadmin verify /home/svn/$projname"` # this one, when I use the script in the terminal, it prompts me the right thing but it seams that the var version doesn't receive the content of the command
echo "Project name: "$projname # here I do a echo just to confirme that the $projname is well stored
echo "Version control revision: "$version # and here the echo shows the $version empty!!

Maybe I can't use version to receive the command???
please help

thanks

Last edited by DukeNuke2; 01-29-2009 at 04:13 AM.. Reason: changed colors, light blue was bad to read...
# 2  
Old 01-29-2009
try to delete the "space" after "version= command" to "version=command" and have a look if this works...
# 3  
Old 01-29-2009
Quote:
Originally Posted by DukeNuke2
try to delete the "space" after "version= command" to "version=command" and have a look if this works...
Gaves me the same, but thanks
# 4  
Old 01-29-2009
ok, try to debug your script some more with setting the "set -xv" option on second line of your file. run the script and have a look for yourself or post the output here...
# 5  
Old 01-29-2009
Quote:
Originally Posted by ruben.rodrigues
Hi!

I strated to script since 1 month and I don't have much expirience but this thing here is strange

I have a script where I want to store a svn command in a var to check it later
so it's like this
[code]
#!/bin/sh
list=`ssh itadmin@192.168.1.200 "ls /home/svn"` # this stores the list of repositories and works fine
projname=`zenity --entry --text "$list

Enter the project name that you want to create "` # this ask to the user to insert the name of the project according to the list and works fine
version= `ssh itadmin@192.168.1.200 "svnadmin verify /home/svn/$projname"` # this one, when I use the script in the terminal, it prompts me the right thing but it seams that the var version doesn't receive the content of the command
echo "Project name: "$projname # here I do a echo just to confirme that the $projname is well stored
echo "Version control revision: "$version # and here the echo shows the $version empty!!Maybe I can't use version to receive the command???
please help

thanks
Sorry for late responce but I had a metting
this is what the script gave me:
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.
Project name: repos
Version control revision:

so, the 1,2 and 3 line are the verbose from the (version= `ssh itadmin@192.168.1.200 "svnadmin verify /home/svn/$projname"`)
which means that the command works but the var version doesn't receive nothing couse in the last line (echo "Version control revision: "$version) the var is empty

Please help
thanks
# 6  
Old 01-29-2009
Redirect the svn's STDERR output to STDOUT with:
Code:
"svnadmin verify /home/svn/$projname 2>&1"

# 7  
Old 01-29-2009
Quote:
Originally Posted by otheus
Redirect the svn's STDERR output to STDOUT with:
Code:
"svnadmin verify /home/svn/$projname 2>&1"

sorry but I don't understand your code. Can you be more expecific for my example? I'm still a beginer
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Configuring 'auditd' service to not store the audit logs in /var partition

Hello all, I've configured 'audit' service to send the audit logs to a remote log server (by using syslog plugin), which is working fine. However, there is a problem. audit service also tries to write same information (but in binary format) in /var/audit path. So, Is there anyway to stop... (2 Replies)
Discussion started by: Anti_Evil
2 Replies

2. Ubuntu

problem with /var/mail directory

Hi, There is no "administrator" file in "/var/mail" directory........ can any one tell me what could be the reason for that?...and also how to resolve that??? Thanks, ~Kavi (4 Replies)
Discussion started by: kavi.mogu
4 Replies

3. Solaris

Disk problem? from /var/adm/messages

Hi all, I got the following error message from solaris 10 system. Security Violations =-=-=-=-=-=-=-=-=-= Jun 1 01:48:21 unix009 scsi: ASC: 0x44 (internal target failure), ASCQ: 0x0, FRU: 0xbc The following are from /var/adm/messages Jun 1 01:48:21 unix009 scsi: WARNING:... (7 Replies)
Discussion started by: lramsb4u
7 Replies

4. Solaris

SVM Problem Regarding /var

Hi Guys! I am facing Problem with SVM I mention the problem below: I have Sunfire V210 machine and the partitions are as follows: Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 6134 29.77GB (6135/0/0) 62429760 1 swap wu ... (1 Reply)
Discussion started by: sensation
1 Replies

5. Shell Programming and Scripting

date output store in variable problem

When I run following command date Output1 => Thu Sep 9 03:26:52 IST 2010 When I store in a varibale as a=`date` echo $a output2 => Thu Sep 9 03:27:02 IST 2010 The differnece is, it is trimming the space when I am storing the output in varibale. Output1 = Thu Sep 9 03:26:52 IST 2010... (2 Replies)
Discussion started by: pravincpatil
2 Replies

6. Shell Programming and Scripting

Problem running var (with spaces) as command

I seem to be fighting bash's shell expansions.. I set this variable: CMD="export MVAR=\"1 2 3\"" if I try to run it, it is clear the shell is parsing along the spaces of the contents of MYVAR: > $CMD + export 'MYVAR="1' 2 '3"' + MYVAR='"1' -bash: export: `2': not a valid identifier... (3 Replies)
Discussion started by: bbw
3 Replies

7. UNIX for Dummies Questions & Answers

/var/run/dbus/system_bus_socket problem

Hello, i have a problem. i have a domain name hosted on a server and it goes very slow and sometimes down. I looked on the processes running and on the netstat status and i discovered that each time there is a slowness or a downtime is caused by: /var/run/dbus/system_bus_socket many of these... (9 Replies)
Discussion started by: dan8354544
9 Replies

8. Shell Programming and Scripting

Problem regarding Sed/Echo/Var Init

Greetings, I've visited this forums for a long time and normally got an right answer but this time my problem doesn't seem to go away. What I'm trying to do is the following: VAR="\n\nline1\nline2\nline3\nline4\nline5\nline6\nline7\n\n" (The count of newlines is varying!) If I echo this i... (3 Replies)
Discussion started by: ph1l
3 Replies

9. Shell Programming and Scripting

Open txt and store line in a var

Hi I realy need to find a way to do a script that does the following: search a word in a txt file then store on a var the letters that are on the right like this is an exemple, I want to store from here ...abcdefg... so I need a var that receive ...abcdefg... Is that possible?... (8 Replies)
Discussion started by: ruben.rodrigues
8 Replies

10. Shell Programming and Scripting

Problem with echo for var, padded with spaces

While concatenating 2 values, one which expanded to fixed width & other not, I am not getting value expanded as fixed width. Following is script for the same : #!/bin/sh var1="abc" var2="def" var1Fxd=`echo $var1 | awk '{printf("%-6s",$0)}'` echo $var1Fxd""$var2 But, if I try - echo... (2 Replies)
Discussion started by: videsh77
2 Replies
Login or Register to Ask a Question