10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. UNIX for Dummies Questions & Answers
I have a file in my unix directory called "restart_job1.job". Below is a sample of the script where I am doing a 'grep' to check specifically for an oracle error. If the value 'ORA-" is found, I set a variable to hold the return code value (job1_return_code). If the return code is non zero, I... (2 Replies)
Discussion started by: ncsthbell_dr
2 Replies
5. Shell Programming and Scripting
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?
echo "The latest version of the program is being found......."
cd $SOFTWARE/src/$progname
version=`ls $SOFTWARE/src/$progname | grep... (13 Replies)
Discussion started by: cyberfrog
13 Replies
6. UNIX for Dummies Questions & Answers
Hi
I have two shell scripts A and B
A calls B
I would like to use a variable in A the value of which is assigned by
B after calling B
Thanks in advance
Suresh (8 Replies)
Discussion started by: ssuresh1999
8 Replies
7. Shell Programming and Scripting
Hi
I have written a script using ftp to get files from one server and copy them to 2 dirrerent servers. I wish to call this script from a parent script that will check the number of files copied and run a check sum for each file. As the filenames for the files in the get portion of the script... (3 Replies)
Discussion started by: Andy82
3 Replies
8. Shell Programming and Scripting
Hi All,
I pass a Perl script variable, whch is passed to a query to be prepared. But the problem is I have special character like '&' in this variable which are handled in a special way by the Oracle query parser. How do I get over this?
my $cust_name='A&B';
my $sql="Select cust_short_name... (1 Reply)
Discussion started by: rahulrathod
1 Replies
9. UNIX for Dummies Questions & Answers
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
10. UNIX for Dummies Questions & Answers
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