Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Syntax error for awk in a loop Post 302648747 by itkamaraj on Wednesday 30th of May 2012 10:12:40 AM
Old 05-30-2012
what is the value of the variable ?

Code:
$new

And do you have a folder called count inside the test directory ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

syntax error in while loop

Hi, I have the following script (compile_mercury) and I get this error: I have no idea why...and I have written this script completely in linux (bash) and not in windows. **************** ./compile_mercury: line 136: syntax error near unexpected token `done' ./compile_mercury: line 136:... (1 Reply)
Discussion started by: habzone2007
1 Replies

2. Shell Programming and Scripting

Problems with syntax in a loop (AWK)

Hi guys, I'm trying to loop through a number of files that is set by whatever is in a field. eg. The idea is to split FILELIST down into fields, it could contain 1 - 999 fields and it's bar delimited. I thought simple, count the number of fields in the field and then loop... (1 Reply)
Discussion started by: Peejay
1 Replies

3. Shell Programming and Scripting

Syntax error: Bad for loop variable

Hi Can any one help, I'm trying to run a script that beeps out the ip address from the PC internal speaker with the following script. It keeps throwing the error "Syntax error: Bad for loop variable" on line 16. I know its picking up the IP ADDRESS correctly. Any ideas on whats wrong. I'm... (3 Replies)
Discussion started by: dman
3 Replies

4. Shell Programming and Scripting

Syntax error: Bad for loop variable

I'm getting an error while running this script. Need help. set -x verbose #echo on clear #clear the screen USERNAME="bbb" PASSWORD="password" SERVER="192.168.1.100" WAIT_TIME=300 FILE_PATH="/home/users/xxx/MMM" # local directory to pickup *.dat file REMOTE_PATH="/Drop_off/xxx/yyy" #... (17 Replies)
Discussion started by: clgz2002
17 Replies

5. Shell Programming and Scripting

IF loop syntax error

I am trying to run a menu option though IF loops. I keep getting errors not allowed the menu to be processed correctly. Currently it will accept the first 2 statements but then crash on the 3rd. The 2nd and 3rd have the same syntax, so I do not understand why it breaks. #!/bin/bash while... (4 Replies)
Discussion started by: Ironguru
4 Replies

6. Shell Programming and Scripting

[Solved] 0403-057 Syntax error `<' is not matched

curr_time=`date +%Y%m%d%H%M` curr_date=`date +%Y%m%d` zero=0 script_path="/home/wccuser1/wcc/Scripts/bulk_file_ftp" file_dir="/home/wccuser1/wcc/Bulk_Files" todays_file_count=`ls -ltr | grep $curr_date | awk '{print $9}' | wc -l` todays_file=`ls -ltr | grep $curr_date | awk '{print $9}'` if... (5 Replies)
Discussion started by: gagandeep
5 Replies

7. Shell Programming and Scripting

[Solved] 0403-057 Syntax error for if statement

I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values tstmb.sh: 1.5321e+08: 0403-057 Syntax error Below is my code snippet. #!/bin/ksh set -x TODAY=$(date +%y%m%d) for file in $(ls -rt *.log | tail... (11 Replies)
Discussion started by: kiran1112
11 Replies

8. Shell Programming and Scripting

[Solved] FOR loop / IF statement returning error

The code at the bottom is a simplified example of what we have. If I use the following: && echo "echo failed" $? returns 1 When I use if ; then echo "echo failed" ; fi $? returns 0 Does anyone know what's wrong with this? Using AIX 6.1 and KSH for NUM in 1 2 3 do ... (5 Replies)
Discussion started by: jfxdavies
5 Replies

9. Shell Programming and Scripting

[Solved] While loop error when add sqlplus command

Hi gurus, I hit a block when write the script. I need do while loop, in the loop I have code below. sqlplus -s abc/abc@abc <<EOF spool testwhile select * from dual; spool off exit; EOF when I run script with only this code, it works fine. if I add code as below: #!/bin/ksh ... (5 Replies)
Discussion started by: ken6503
5 Replies

10. UNIX for Dummies Questions & Answers

Syntax error in for loop

I am using simple for loop, but getting syntax error when I run the code code #!/bin/ksh pls enter number read n for(i=1; i<=n; i++) do echo $i done syntax error + pls enter number + read n (5 Replies)
Discussion started by: stew
5 Replies
Encode::Alias(3pm)					 Perl Programmers Reference Guide					Encode::Alias(3pm)

NAME
Encode::Alias - alias definitions to encodings SYNOPSIS
use Encode; use Encode::Alias; define_alias( newName => ENCODING); DESCRIPTION
Allows newName to be used as an alias for ENCODING. ENCODING may be either the name of an encoding or an encoding object (as described in Encode). Currently newName can be specified in the following ways: As a simple string. As a qr// compiled regular expression, e.g.: define_alias( qr/^iso8859-(d+)$/i => '"iso-8859-$1"' ); In this case, if ENCODING is not a reference, it is "eval"-ed in order to allow $1 etc. to be substituted. The example is one way to alias names as used in X11 fonts to the MIME names for the iso-8859-* family. Note the double quotes inside the single quotes. If you are using a regex here, you have to use the quotes as shown or it won't work. Also note that regex handling is tricky even for the experienced. Use it with caution. As a code reference, e.g.: define_alias( sub { return /^iso8859-(d+)$/i ? "iso-8859-$1" : undef } , ''); In this case, $_ will be set to the name that is being looked up and ENCODING is passed to the sub as its first argument. The example is another way to alias names as used in X11 fonts to the MIME names for the iso-8859-* family. Alias overloading You can override predefined aliases by simply applying define_alias(). The new alias is always evaluated first, and when neccessary, define_alias() flushes the internal cache to make the new definition available. # redirect SHIFT_JIS to MS/IBM Code Page 932, which is a # superset of SHIFT_JIS define_alias( qr/shift.*jis$/i => '"cp932"' ); define_alias( qr/sjis$/i => '"cp932"' ); If you want to zap all predefined aliases, you can use Encode::Alias->undef_aliases; to do so. And Encode::Alias->init_aliases; gets the factory settings back. SEE ALSO
Encode, Encode::Supported perl v5.8.0 2002-06-01 Encode::Alias(3pm)
All times are GMT -4. The time now is 09:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy