06-23-2009
The problem is caused by not escaping characters which will be interpreted by the shell (e.g. dollar and backtick ... and maybe more) where you want them to appear in the new script. It might be easier to write the script in the normal manner and call it with a parameter.
If you persist with this approach, test thoroughly before executing the new script.
The lines starting ... echo "echo ... need attention to stop the pipe becoming active in the new script because the echoed string will not be in quotes.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I need to schedule a shell script that runs at the command prompt to run with crontab. When I run this at the command prompt as follows it works:
echo /usr/test/script.sh date1 date2 y | at 20:00
But if I will pass these argument (date1, date2, Y) with in a shell script (say scr1.sh) and... (7 Replies)
Discussion started by: keerthi
7 Replies
2. Shell Programming and Scripting
Hi,
I wish to store $string1 in $string1array a character in each array element.
Then i wish to echo the entire array to the screen so that it reads as the normal string again.
I have been trying with the code below but does not work. Please help...
To put string into array:
... (5 Replies)
Discussion started by: rorey_breaker
5 Replies
3. Shell Programming and Scripting
could anyone tell me why when i execute the following script, echo returns blank
set k = 1
echo $k (9 Replies)
Discussion started by: saman_glorious
9 Replies
4. Homework & Coursework Questions
first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies
5. Shell Programming and Scripting
This may be little confusing. I have Script1, which pulls data from the system and creates another script(lets say script2). While I run script1 I need to add printf/echo statements for script2, so that when I run script2 I see those statement.
eg: script1 765
printf " display frame-$1 timeoffset... (2 Replies)
Discussion started by: miltonrods
2 Replies
6. Shell Programming and Scripting
Hi,
I have a file output.txt
3258 14
32647 10
32649 10
32650 10
32651 10
32652 10
32653 10
32654 10
32655 10
32656 10
32515 09
32478 08
32555 08
35888 08 (4 Replies)
Discussion started by: amit_spl
4 Replies
7. Shell Programming and Scripting
Trying to insert a backspace for echo.
while true ; do
i='-\|/'
for j in 1 2 3 4
do
echo -ne "$(echo ${i} | cut -c${j})"
sleep 1
done
done
this currently outputs:
-\|/-\|/-\|/-\| .....etc
---------- Post updated at 02:34 PM ---------- Previous update was at 02:10 PM... (7 Replies)
Discussion started by: squrcles
7 Replies
8. UNIX for Dummies Questions & Answers
Hello Friends,
I am a new learner of Unix & need to understand below script as start up,
Can anyone explain the meaning of each line listed below.
Thanks for your time.
#!/usr/bin/ksh
PARAMS=$1
#echo "parms passed is $PARAMS @"
STATUS=`echo ${PARAMS} | cut -d: -f1`
JOBNAME=`echo... (9 Replies)
Discussion started by: DK2014
9 Replies
9. Shell Programming and Scripting
HI
I have and echo command which works perfectly in the shell but when i execute in the script it gives me an error code
query is as below
QUERY=`echo "Select Severity,Dupl_count,Creation_Time,Last_Received,Node_Name,Node_Name,Object,Message_Group,Message_Text,Last_Annotation from " \
... (2 Replies)
Discussion started by: Jcpratap
2 Replies
10. Shell Programming and Scripting
I am writing a bash script that automatically generates a macro program.
I want to have an echo on multiple lines and getting an error
/home/chaos/instru-correct.sh: line 309: command line is: command not found
I am using
echo "# The general synopsis of the $mfl" \
... (2 Replies)
Discussion started by: kristinu
2 Replies