Sponsored Content
Top Forums Shell Programming and Scripting perl/unix: script in command line works but not in perl Post 302487125 by pravin27 on Tuesday 11th of January 2011 01:25:38 PM
Old 01-11-2011
Hi,

Remove pipe after sort.

Code:
my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';
system($query);

This User Gave Thanks to pravin27 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

E-Mail from command line for UNIX and Perl??

Hi Is there any way to use UNIX and Perl to automate sending e-mail. I got a dynamic changing file that send out to people in my mailing list and want to experinment to see if Perl and UNIX can send it out for me when the content is change. I found a Perl source code but dont really know how to... (4 Replies)
Discussion started by: jy2728
4 Replies

2. Shell Programming and Scripting

perl - how come this script works?

#!/usr/bin/perl open (DATA, file.txt); @array = <DATA>; close (DATA); open (DATA, ">$file.txt"); for (@array) { s/text/replace text/; push(@contents,$_); } seek(DATA, 0, 0); print DATA (@contents); close(DATA); could someone please explain how this works. i've been... (3 Replies)
Discussion started by: mjays
3 Replies

3. Shell Programming and Scripting

changing from command line to perl script

I had posted previously about this problem I had. I have multiple text files with hundreds of lines of the following type: 2000001 34 54 234 2000001 32 545 2000001 -2000001 77 2000001 44 2000001 998 2000001 77 32 2000001 45 23 111 89 98 75 23 34 999 . . . etc... What I wanted was... (2 Replies)
Discussion started by: xchen89x
2 Replies

4. Shell Programming and Scripting

perl oneliner not works .pl script

I am trying to take first 3 columns in a file which matches the word "abc", but i am getting the below error, <error> Global symbol "@F" requires explicit package name at ./new.pl </error> whereas when i give the below,grep abc /home/test/file.txt|perl -lane 'print \"$F $F $F\" in unix prompt... (4 Replies)
Discussion started by: anspks
4 Replies

5. Shell Programming and Scripting

Run perl script, with command-line options

Hello everyone, I have a perl script which takes various command line options from user like : test.pl -i <input_file> -o <output_file> -d <value> -c <value> Now I have multiple input files in a directory: <input_file_1> <input_file_2> <input_file_3> <input_file_4> ..... .... ...... (6 Replies)
Discussion started by: ad23
6 Replies

6. Shell Programming and Scripting

perl script - command line parameter

i am a beginner, i want to make a program that takes any command line arguments... and print it out in reverse. ie. if the command line argument is "thanks for helping me" i want it to output "me helping for thanks" :D i have tried using the reverse command, but i cant get it working!! ... (3 Replies)
Discussion started by: bshell_1214
3 Replies

7. Shell Programming and Scripting

Using UNIX command in perl script.

I wish to know if there is any limitation in using unix commands in perl script or it is just we should avoid using them in our perl script. For e.g Below is the command to get the recent file in a dir.: $lcsvFile = `cd "$l_inputfilepath";ls -1t *.CSV|tail -1` Is there any harm in coding... (1 Reply)
Discussion started by: Devesh5683
1 Replies

8. Shell Programming and Scripting

perl: Command works in terminal, but not in shell script

Hi, the following command works in the terminal no problem. samtools view -h rawlib.bam | perl -ne '{ @line = split( /\s+/ ); $match = 0; while( $line =~ /(\d+)M/g ) { $match = $match + $1 } if( $match >= 80 || $_ =~ /^\@/ ) { print $_ } }' | java -Xmx12G -jar... (8 Replies)
Discussion started by: jdilts
8 Replies

9. Shell Programming and Scripting

Perl error in batch command but works one at a time

In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :). ... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Need to understand how the line in perl program works as shell commend

I have a file with two line, one is header, the other actual value: TYPCD|ETID2|ETID|LEG ID|PTYP|PTYP SUB|TRD STATUS|CXL REASON|CACT|CACTNM|ENCD|ENC D NM|TRDR|ASDT|TRDT|MTDT|STDT|LS|SECID|SECID TYP|SECNM|PAR|STCC|MARKET PRICE|DIS MARKET PRICE|MARKET PRICE CURRENCY|SRC OF SETTLEMENT... (2 Replies)
Discussion started by: digioleg54
2 Replies
set_color(1)                                                           fish                                                           set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy