list in shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting list in shell
# 1  
Old 03-11-2009
list in shell

when i give this command at prompt it works
Code:
paste <(cut -f1 file1) <(cut -f3 file2) | someawkscript

but when the same is addex to any shell script and run it does not work
the erro is at (
even if i enclose in single or double quotes or enclose the entire
line in double quotes it does not work.

any help

Last edited by Yogesh Sawant; 03-31-2009 at 02:53 PM.. Reason: added code tags
# 2  
Old 03-11-2009
Please post the entire output and the complete error message.
The first think that comes to mind is that the script is interpreted by a shell different than yours (i.e. check the shebang).
# 3  
Old 03-11-2009
#my script is file named "q" and input comes from file named "file1"
paste <(cut -c37-42 file1) <(cut -c43-53 file1 |amtawk )
q: syntax error at line 1: `(' unexpected
"paste <(cut -c37-42 file1) <(cut -c43-53 file1 |amtawk )"
q: paste <(cut -c37-42 file1) <(cut -c43-53 file1 |amtawk ): not found
q: syntax error at line 1: `)' unexpected
paste <\(cut -c37-42 file1\) <\(cut -c43-53 file1 |amtawk \)
q: (cut: cannot open
awk: can't open file ): No such file or directory (error 2)
source line 4 of program <<
{
samt = substr($0 ... >>
paste <"(cut -c37-42 file1") <"(cut -c43-53 file1|amtawk")
q: syntax error at line 1: `)' unexpected
paste <"(cut -c37-42 file1) <(cut -c43-53 file1|amtawk")
q: syntax error at line 1: `)' unexpected

# 4  
Old 03-11-2009
Please post the entire script. You can also try executing the code with a different shell. Try with bash:

Code:
bash ./q

# 5  
Old 03-11-2009
some homework and got the solution.

my default shell interpreter is bsh/sh
adding a line at the beginning was the trick
SHELL=/bin/ksh


thank u anyway
# 6  
Old 03-11-2009
make sure your 'script' is interpreted by the same shell interpreter as you're using for your 'command line', i.e. specify a proper '#!/bin/<myCLIshell>' in your script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

List Files being deleted in a shell script

Good evening, i need your help please I've got a file script thet deletes about half millions of files, and i want those files to be printed in a log file as an evidence those files were removed. #/bin/sh rm "/home/e-smith/files/users/bill/Maildir/cur/1392373930.28512.comp01:2,S" rm... (6 Replies)
Discussion started by: alexcol
6 Replies

2. Shell Programming and Scripting

Distribution List in shell script

Hello Experts, Am trying to include my DL in the shell script,I can see in the logs that mail was sent w/o any return error.But we did not receive any email from the respective VM.When we are trying to giving Individual email-ids it is working fine. Can someone help me out here ? Do we... (3 Replies)
Discussion started by: ahmed.vaghar
3 Replies

3. Shell Programming and Scripting

List of Shell Env Vars

Hia, echo ${!S*} gives me all those env vars starting with S like SHELL SECONDS SHELLOPTS SHLVL etc. is there any way to deflate the shell variables' range like echo ${!A-E*} OR echo ${!A..S*} to list all env vars starting within range of A till E. Thanks Regards, Nasir (1 Reply)
Discussion started by: busyboy
1 Replies

4. UNIX for Dummies Questions & Answers

List of 'if -f' options - AIX / Korn Shell

Hi all, Can someone point me in the right direction for a manual on the various statement options for 'if'. Basically I have a piece of code which says: if ] and I wondered what the -f was. I know the '!' means not equal.. As usual any help much appreciated.. (5 Replies)
Discussion started by: Grueben
5 Replies

5. Shell Programming and Scripting

List of dangerous shell commands

Hello, I have a Application which needs to run shell scripts in a elevated state (root) for system interrogation. So I execute each script using bash -C. This has worked really well. I now want to add another layer of security, I cant inspect each of the scripts before they get deployed to the... (4 Replies)
Discussion started by: tjones1105
4 Replies

6. Red Hat

List shell of specific account

Hi everyone. I am wondering how I would accomplish outputting the shell of a specific account on a single line of output. For example I would like to list the shell of 'news' as... /bin/sh providing its current shell is /bin/sh. This probably is a simple answer that I haven't been able to... (2 Replies)
Discussion started by: austinharris43
2 Replies

7. Red Hat

How to list shell of account?

Hello. I have been trying to figure out something very simple that I know I've done before; which is list the shell of a specific account. In this case it is the account: "news". I know how to change the shell using chsh, just not list it. I want output like "/bin/sh" only. Any thoughts or... (5 Replies)
Discussion started by: austinharris43
5 Replies

8. Shell Programming and Scripting

Parsing the list in korn shell

Hi I wanted to print/store just a specific element of the list . I have got the list as an output of grep command. here is code snap below : end_no=`egrep -ni '!return code: 0|return code other than 0' temp.log | cut -d':' -f1` this will return the line numbers in end_no. I just... (2 Replies)
Discussion started by: Shell@korn
2 Replies

9. Shell Programming and Scripting

Shell Scripting Reading List

Hello Everyone, Over the last few months I have begun to expand my programing skills from windows, Java and SQL / PL-SQL programing into the wonderful world of shell scripting. With little training budget my only options for training are books, Internet and this site (BTY... (1 Reply)
Discussion started by: caddis
1 Replies

10. Shell Programming and Scripting

String compare with list in shell script

Hi , I am new to shell scripting. below is my requirement : 1) while running my .sh i will pass a string 2) i have to extract a folder name under a /config folder 3) i need to compare a input string in the folder name list 4) if that is true i have to continue my job else i have to... (2 Replies)
Discussion started by: rajinavaneethan
2 Replies
Login or Register to Ask a Question