05-05-2009
echo $$variable problem
Hi,
I see a similar problem.
> set home_var MYHOME
> eval echo 'set path \($$home_var/bin \$path\)' > ~/hi.txt
The hi.txt has
set path (7030home_var/bin $path)
I need
set path ($MYHOME/bin $path)
Please help
Thank you
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Have the following lines in a script: echo "-----------------------------------------------"\
"---------------------" >> $xdfrpt
echo "- Date - - / - /stand - /u - /u1 - /u2 -"\
"/x1 - /x2 - /x3 -" >> $xdfrpt
echo... (1 Reply)
Discussion started by: Cameron
1 Replies
2. Shell Programming and Scripting
Hi,
I have given the following statement in a script to put the values of variables (VAR1, VAR2,...) in a file.
echo " $VAR1 $VAR2 $VAR3 $VAR4 $VAR5" >> filename
But the output is not coming properly. Variables VAR5, VAR4 are replacing the first (VAR1, VAR2,..). I can't... (5 Replies)
Discussion started by: abrd600
5 Replies
3. Shell Programming and Scripting
hi
I have say five variable.
I would ask the user which one they want me to print and then print accordingly.
TEST_1='10.2.3.4'
TEST_2='11.2.3.5'
TEST_3='12.2.3.5'
TEST_4='13.2.3.5'
TEST_5='14.2.3.5'
print_var()
{
echo "Accessing var num $1"
echo TEST$1
#??? But How do... (6 Replies)
Discussion started by: sabina
6 Replies
4. Shell Programming and Scripting
echo "XXXXX" >> /xx/output.txt
cat /xx/file.txt| awk '{tony=tony+$1+$2; print tony/$3*100}' >> /xx/output.txt
Dear all,
In this situation i will have 2 lines in the output file. What i want is to have only one output line. e.g: XXXXX "value"
HOW to put the output of the "cat and awk" in... (1 Reply)
Discussion started by: tontal
1 Replies
5. Shell Programming and Scripting
Hello all,
Please help with the below.
I have a requirement where in I have to read a pattern and print it as shown below.
Patterns will be as below.
Input Output
Pattern Should be printed as below with spaces such that I can awk.
-*--* - * - - *
*--**... (2 Replies)
Discussion started by: tenderfoot
2 Replies
6. Shell Programming and Scripting
hi all
i have little problem below is my shell script
a=`sqlplus fss_cst/fss_cst@dolp1 << EOF
SET PAGESIZE 0 FEEDBACK OFF TRIMOUT ON;
select process from lfs$ta_process where valid_to_dat=to_date('9/16/2010','mm/dd/yyyy');
EOF`
echo ${SQL}
the script name is test2.sh
when i execute... (5 Replies)
Discussion started by: aishsimplesweet
5 Replies
7. Shell Programming and Scripting
I'm parsing a router configuration file and printing out some of the fields. Given the following output,
I'd like to add the filename to the first column. I'm definately a neophyte in scripting.
COUNTER=${#array1
}
while ; do
######## echo -n $JUNOS_FILE | ... (3 Replies)
Discussion started by: nocleader
3 Replies
8. Shell Programming and Scripting
Hi
I am facing a strange problem
a=03
echo ${a}
the output is 3
But i want to display it is 03
Can you people help me how to display it like 03.
Thanks (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
9. Shell Programming and Scripting
Hey all! I'm in an intro to UNIX class at university, and we've just began writing scripts. Naturally I can't get it to do what I want.
Basic script as follows:
COMPARE1=`ls|wc -l`
tar czf archive.tgz ~/path/to/file
COMPARE2=`tar tvzf archive.tgz|wc -l`
if
then
... (7 Replies)
Discussion started by: nickzourdos
7 Replies
10. Shell Programming and Scripting
I am trying to get ascii file using echo command, e.g. -
echo "\050"
It is correctly working on RHEL 4 but not in RHEL 5. Please help me to fix the issue.
## Working as expected in RHEL 4
$ lsb_release -d
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
$ echo... (4 Replies)
Discussion started by: atanubanerji
4 Replies
CPMAC(1) BSD General Commands Manual CPMAC(1)
NAME
/usr/bin/CpMac -- copy files preserving metadata and forks
SYNOPSIS
/usr/bin/CpMac [-rp] [-mac] source target
/usr/bin/CpMac [-rp] [-mac] source ... directory
DESCRIPTION
In its first form, the /usr/bin/CpMac utility copies the contents of the file named by the source operand to the destination path named by
the target operand. This form is assumed when the last operand does not name an already existing directory.
In its second form, /usr/bin/CpMac copies each file named by a source operand to a destination directory named by the directory operand. The
destination path for each operand is the pathname produced by the concatenation of the last operand, a slash, and the final pathname compo-
nent of the named file.
The following options are available:
-r If source designates a directory, /usr/bin/CpMac copies the directory and the entire subtree connected at that point. This option also
causes symbolic links to be copied, rather than indirected through, and for /usr/bin/CpMac to create special files rather than copying
them as normal files. Created directories have the same mode as the corresponding source directory, unmodified by the process' umask.
-p Causes /usr/bin/CpMac to preserve in the copy as many of the modification time, access time, file flags, file mode, user ID, and group
ID as allowed by permissions.
-mac Allows use of HFS-style paths for both source and target. Path elements must be separated by colons, and the path must begin with a
volume name or a colon (to designate current directory).
NOTES
The /usr/bin/CpMac command does not support the same options as the POSIX cp command, and is much less flexible in its operands. It cannot
be used as a direct substitute for cp in scripts.
As of Mac OS X 10.4, the cp command preserves metadata and resource forks of files on Extended HFS volumes, so it can be used in place of
CpMac. The /usr/bin/CpMac command will be deprecated in future versions of Mac OS X.
SEE ALSO
cp(1) MvMac(1)
Mac OS X April 12, 2004 Mac OS X