Sponsored Content
Top Forums Shell Programming and Scripting My variable cannot be passed through into my path Post 302347803 by cyberfrog on Wednesday 26th of August 2009 12:15:26 PM
Old 08-26-2009
My variable cannot be passed through into my path

Hi,
Can you please help. I am scripting in sh and I am trying to simply copy one directory to another but for some reason my variables are not recognised?

HTML Code:
echo "The latest version of the program is being found......."
cd $SOFTWARE/src/$progname
version=`ls $SOFTWARE/src/$progname | grep 'v00*'  | tail -1`
echo "Latest version for $progname is $version"
 
#Copy over the latest version of the program
cp -r $SOFTWARE/src/$progname/$version $SOFTWARE/devl/$progname
The problem is to do with the $version variable it seems because when I subsitute $version with a directory name that is hard coded it works BUT when you simply echo $version it also looks correct. Do I need to convert it to a different format or something?

CF
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

variable passed to awk

Anybody know what's wrong with this syntax? awk -v job="$job" 'BEGIN { FS="|"} {print $1,$2," ",$4," ",$3\n,$5,"\n"}' list It's keeping give me this message: awk: syntax error near line 1 awk: bailing out near line 1 It seems awk has problem with my BEGIN command. Any... (8 Replies)
Discussion started by: whatisthis
8 Replies

2. UNIX for Dummies Questions & Answers

variable passed to awk

Does anybody know how to print a variable passed to awk command? awk -F"|" 'BEGIN {print $job,"\n","Question \n"} {print $1,$2$4," ",$3}' "job=$job1" file1 I am trying to pass job the variable job1. the output is blank. ?? (3 Replies)
Discussion started by: whatisthis
3 Replies

3. UNIX for Dummies Questions & Answers

Assigning a Variable all the Parameters passed

Hi, I have a unix script which can accept n number of parameters . I can get the parameter count using the following command and assign it to a variable file_count=$# Is there a similar command through which i can assign a variable all the values that i have passed as a parameter ... (2 Replies)
Discussion started by: samit_9999
2 Replies

4. Shell Programming and Scripting

how to find the path of a file when it is passed as ....filename(parameter) to script

hi unix guru's..................:confused: question is posted in the #3 permalink shown below. (3 Replies)
Discussion started by: yahoo!
3 Replies

5. UNIX for Advanced & Expert Users

Value of variable not getting passed in child script

Hi, I am facing a challenge in fixing an issue in my installation scripts.Here is a situation: There are 3 files which are invoked at a below given order: Installer.ksh----->Installer.xml(Ant script)------->common.ksh I am outputting a message from common.ksh at a terminal, after that trying to... (3 Replies)
Discussion started by: baig_1988
3 Replies

6. Shell Programming and Scripting

[SSH] Accessing remote directory with user-passed path

Hi everybody, Currently, I have a script which access a remote computer via SSH, go to a folder already defined in the code and then executes a program in it, just like that: ssh user@host << EOI cd path ./file EOI It executes fine, but now I want to pass an argument in the command... (2 Replies)
Discussion started by: lgb3
2 Replies

7. Shell Programming and Scripting

In the sh file variable is not being passed on.

I am having difficulties with the fllowing script: !/bin/sh voicemaildir=/var/spool/asterisk/voicemail/$1/$2/INBOX/ echo `date` ':' $voicemaildir >> /var/log/voicemail-notify.log for audiofile in `ls $voicemaildir/*.wav`; do transcriptfile=${audiofile/wav/transcript} ... (4 Replies)
Discussion started by: ghurty
4 Replies

8. Shell Programming and Scripting

Variable passed as argument

I have a script. #!/bin/sh cur_$1_modify_time=Hello echo "cur_$1_modify_time" When I run like sh /root/script1 jj I expect value "Hello" being assigned to variable "cur_jj_modify_time" and output being "Hello" ie echoing $cur_jj_modify_time But the output comes as # sh... (3 Replies)
Discussion started by: anil510
3 Replies

9. Shell Programming and Scripting

Variable not passed to the sed command

Hello, I am writing a script which is not giving the desired result. When I check the content of the 'InputFile_009_0.sh', it shows following with missing Index in this command sed -i "s/L1ITMBLT.root/L1ITMBLT_"".root/g" run_DttfFromCombinedPrimitives_cfg.py of . Any help? ... (13 Replies)
Discussion started by: emily
13 Replies

10. Shell Programming and Scripting

Bash variable not being passed

In the bash below the variable date displays in the echo. However when I use it in the for loop it does not. Basically, the user inputs a date then that date is converted to the desired format of (month-day-year, no leading 0). That input is used in the for loop to return every file that matches... (5 Replies)
Discussion started by: cmccabe
5 Replies
CipUX::CAT::Web::Module::ServerInfo(3pm)		User Contributed Perl Documentation		  CipUX::CAT::Web::Module::ServerInfo(3pm)

NAME
CipUX::CAT::Web::Module::ServerInfo - Lists all perl versions of CipUX VERSION
This document describes CipUX::CAT::Web::Module::ServerInfo version 3.4.0.3 SYNOPSIS
This CAT Web module can be used to see installed CipUX Perl module versions. DESCRIPTION
This CAT Web module can be used to see installed CipUX Perl module versions. INTERFACE
module Use this method to start the list. DIAGNOSTICS
Throws the error To use this module, please install Module::List::Pluggable! if Module::List::Pluggable is not installed. CONFIGURATION AND ENVIRONMENT
CipUX::CAT::Web::Module::ServerInfo requires no configuration files or environment variables. However it merges its configuration from CipUX::CAT::Web::Module and itself. DEPENDENCIES
Log::Log4perl CipUX::CAT::Web::Module Module::List::Pluggable INCOMPATIBILITIES
None reported. BUGS AND LIMITATIONS
No bugs have been reported. AUTHOR
Christian Kuelker "<christian.kuelker@cipworx.org>" LICENCE AND COPYRIGHT
Copyright (C) 2010, Christian Kuelker "<christian.kuelker@cipworx.org>". All rights reserved. This module is free software; you can redistribute it and/or modify it under the GNU GPL licence version 2 or any later version. DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. perl v5.14.2 2012-12-07 CipUX::CAT::Web::Module::ServerInfo(3pm)
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy