Sponsored Content
Top Forums Shell Programming and Scripting sed error : Syntax error: redirection unexpected Post 302264468 by Christoph Spohr on Thursday 4th of December 2008 04:02:26 AM
Old 12-04-2008
Hi,

first you don't need cat. You can invoke sed and give it a filename a parameter.

Sed syntax is:

Code:
sed 's///' file

If your search-replace-string contains "/", you have to escape them.

HTH Chris
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sh: syntax error: `...' unexpected???

Hello all, I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`: #!/usr/bin/ksh if ] then mailx... (5 Replies)
Discussion started by: alan
5 Replies

2. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

3. Shell Programming and Scripting

unexpected syntax error

Hi, i am getting following syntax error ...kingly advice why is it coming ?? #!/bin/bash find . -name "common.log" if ; then echo "1" fi Himnashu@home /bin $ ./a.sh ./a.sh: line 7: syntax error near unexpected token `fi' ./a.sh: line 7: `fi' (9 Replies)
Discussion started by: himvat
9 Replies

4. Shell Programming and Scripting

syntax error: `$' unexpected

Hi all, Am very new to Unix and am currently Involved in Migrating some Shell Scripts from AIX 4 to Solaris 10. While using teh for loop am getting the below error: $ echo $SHELL /usr/bin/ksh $ for file in $(ls *SEBE*) syntax error: `$' unexpected while the same works without issue on... (4 Replies)
Discussion started by: paragkhanore
4 Replies

5. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

6. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies

7. Shell Programming and Scripting

Syntax error: 'fi' unexpected

unzip file.zip if ] ; then echo "Success" else echo "Some failure." fi ; I tried many time to detect the unzip error, but it keep show the syntax error wherever how I change the syntac. Hope someone can help me fix the issue, thanks. Please use code tags next time for your code and... (5 Replies)
Discussion started by: duncanyy
5 Replies

8. Shell Programming and Scripting

Syntax error `(' unexpected

I have written this in my script but while running i am getting syntax error `(' unexpected. unload to "$BACKUP_DIR/n_fac_fid-$clliname" select * from n_fac_fid where fac_accesskey in (select fac_accesskey From n_fac_ap_fid where ap_clli="$clliname"); Any help appreciated. (3 Replies)
Discussion started by: suryanmi
3 Replies

9. UNIX for Beginners Questions & Answers

Getting this error syntax error near unexpected token `)'

Hi Everyone, my script was running Ok, but suddenly it started giving this error. ./update_env_bi.sh: line 54: syntax error near unexpected token `)' ./update_env_bi.sh: line 54: `sed -i "s/PORT=*1/PORT=$2/" repository.xml' The line 54 has this code. sed -i "s/PORT=*1/PORT=$2/"... (2 Replies)
Discussion started by: shajay12
2 Replies

10. Shell Programming and Scripting

Syntax error: `]' unexpected

I am getting this error Syntax error: `]' unexpected. Did I do something wrong with elif? Does ksh not like double brackets? if ]; then #echo hi source ~/.bashrc; elif ]; then #echo hi source ~/.kshrc; fi (5 Replies)
Discussion started by: cokedude
5 Replies
STARPU_WORKERS_ACTIVITY:(1)					   User Commands				       STARPU_WORKERS_ACTIVITY:(1)

NAME
starpu_workers_activity: - manual page for starpu_workers_activity: 40: [: --version: unexpected operator DESCRIPTION
./starpu_workers_activity: 40: [: --help: unexpected operator ./starpu_workers_activity: 40: [: --help: unexpected operator ./starpu_work- ers_activity: 45: [: --help: unexpected operator ./starpu_workers_activity: 45: [: --help: unexpected operator ./starpu_workers_activity: 45: [: --help: unexpected operator Error. File <--help> not found Offline tool to display the activity of the workers during the execution. The starpu_fxt_tool utility now generates a file named 'activity.data' which can be processed by this script to generate a plot named activity.eps Typical usage: ./starpu_fxt_tool -i /tmp/prof_file_foo ./starpu_workers_activity activity.data OPTIONS
-h, --help display this help and exit -v, --version output version information and exit -h, --help display this help and exit -v, --version output version information and exit REPORTING BUGS
Report bugs to <starpu-devel@lists.gforge.inria.fr> ./starpu_workers_activity: 40: [: --version: unexpected operator ./starpu_workers_activity: 45: [: --version: unexpected operator ./starpu_workers_activity: 45: [: --version: unexpected operator ./starpu_workers_activity: 45: [: --version: unexpected operator Error. File <--version> not found Offline tool to display the activity of the workers during the execution. The starpu_fxt_tool utility now generates a file named 'activity.data' which can be processed by this script to generate a plot named activity.eps Typical usage: ./starpu_fxt_tool -i /tmp/prof_file_foo ./starpu_workers_activity activity.data Report bugs to <starpu-devel@lists.gforge.inria.fr> starpu_workers_activity: 40: [: --version: unexpected operator November 2013 STARPU_WORKERS_ACTIVITY:(1)
All times are GMT -4. The time now is 05:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy