| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Hi, all: I ran the following command: # ll ../ | awk '{print $9}' | sort > filelist But it behaves differently in each system. File generated on Linux system: -rw-r----- 1 user asic 631 Aug 26 16:09 filelist File generated on Solaris system: -rw-r----- 1 user asic 402 Aug 26 16:11 filelist Using cat always sees correct result. But using vi to open filelist can see extra characters at front and end of every line if the file is generated in Linux, see below. How come? How to fix it? I need it to run correctly in both Linux and Solaris, in both csh and tcsh if possible. Thanks. # cat filelist Astro.setup calibre.setup compare_result_HERC_1_2.txt compare_result.txt curly_brace_lines.txt curly_brace_pairs.txt HERC_1 HERC_2 herc_debug.txt icc.setup ll.txt processed_curly_brace_lines.txt top_biranit.LAYOUT_ERRORS top_biranit.LAYOUT_ERRORS_wrong top_biranit_merge.LAYOUT_ERRORS herc_drc_comp_0 herc_drc_comp_1 herc_drc_comp_2 herc_drc_debug show_param compare_result.txt_swap_file_check_folder vi filelist ^[[00mAstro.setup^[[00m ^[[00mcalibre.setup^[[00m ^[[00mcompare_result_HERC_1_2.txt^[[00m ^[[00mcompare_result.txt^[[00m ^[[00mcurly_brace_lines.txt^[[00m ^[[00mcurly_brace_pairs.txt^[[00m ^[[00mHERC_1^[[00m ^[[00mHERC_2^[[00m ^[[00mherc_debug.txt^[[00m ^[[00micc.setup^[[00m ^[[00mll.txt^[[00m ^[[00mprocessed_curly_brace_lines.txt^[[00m ^[[00mtop_biranit.LAYOUT_ERRORS^[[00m ^[[00mtop_biranit.LAYOUT_ERRORS_wrong^[[00m ^[[00mtop_biranit_merge.LAYOUT_ERRORS^[[00m ^[[01;32mherc_drc_comp_0^[[00m ^[[01;32mherc_drc_comp_1^[[00m ^[[01;32mherc_drc_comp_2^[[00m ^[[01;32mherc_drc_debug^[[00m ^[[01;32mshow_param^[[00m ^[[01;34mcompare_result.txt_swap_file_check_folder^[[00m |
|
#2
|
| On Tuesday 26 August 2008 14:10, Kuhl wrote: > Hi, all: > > I ran the following command: > # ll ../ | awk '{print $9}' | sort > filelist > But it behaves differently in each system. > > File generated on Linux system: > -rw-r----- 1 user asic 631 Aug 26 16:09 filelist > > File generated on Solaris system: > -rw-r----- 1 user asic 402 Aug 26 16:11 filelist > > Using cat always sees correct result. But using vi to open filelist > can see extra characters at front and end of every line if the file is > generated in Linux, see below. How come? How to fix it? I need it to > run correctly in both Linux and Solaris, in both csh and tcsh if > possible. ll is an alias or function. What's the command it actually runs? It looks like in linux it produces a colorized listing, and the ansi escape sequences are incorrectly included in the resulting file. -- All the commands are tested with bash and GNU tools, so they may use nonstandard features. I try to mention when something is nonstandard (if I'm aware of that), but I may miss something. Corrections are welcome. |
|
#3
|
| Hi, thanks for the solution. :-) |
![]() |
| Thread Tools | |
| Display Modes | |