![]() |
|
|
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 |
| Assigning output to a variable | jpmena | Shell Programming and Scripting | 3 | 03-27-2008 04:39 AM |
| assigning nawk output to shell variable | user_prady | Shell Programming and Scripting | 6 | 11-29-2007 04:01 AM |
| assigning command output to a shell variable | kprattip | Shell Programming and Scripting | 2 | 07-09-2007 05:01 AM |
| Assigning output of command to a variable | oma04 | Shell Programming and Scripting | 5 | 06-27-2006 01:11 PM |
| Assigning a shell variable as a float | spieterman | Shell Programming and Scripting | 3 | 09-16-2002 10:02 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Assigning output of command to a variable in shell
hi,
I want to assign find command result into some temporary variable: jarPath= find /opt/lotus/notes/ -name $jarFile cho "the jar path $jarPath" where jarPath is temporary variable. Can anybody help on this. Thanks in advance ----Sankar |
|
||||
|
Quote:
Hi, Its not working...See i have written this code in some file called Notes.start from bash i run like that ./Notes.start its not giving any output.... Is there any constraints on different shell.I want to run the same file in AIX/Solaris/unix/linux. and i am new this unix.. -sankar |
|
||||
|
this should work provided following are correct
Under /opt/lotus/notes/, there should be a file or directory with name in variable '$jarFile'. Can you run the script in debug mode ? (give 'set -x' in the begining of the script) and paste the result here ? |
|
||||
|
Quote:
file Name :::Notes_debug.start set -x jarFile=Notes.jar if [ -f "$jarFile" ]; then jarPath=`pwd` fi if [ $jarPath="" ]; then jarPath= find /opt/lotus/notes/ -name $jarFile echo "the jar path $jarPath" fi Output + jarFile=Notes.jar + [ -f Notes.jar ] + [ = ] + find /opt/lotus/notes/ -name Notes.jar + jarPath= /opt/lotus/notes/65040/ibmpow/Notes.jar + echo the jar path the jar path |
![]() |
| Bookmarks |
| Tags |
| linux, solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|