Sponsored Content
Top Forums Shell Programming and Scripting Merge all the files in a folder in FIFO order Post 302656245 by Corona688 on Thursday 14th of June 2012 11:19:34 AM
Old 06-14-2012
It probably means what it says. It checks in the current folder for a file named "a.txt" or whatever, and it's not there.

I'm guessing you're not listing the current, hence why it can't find those files -- it's looking in the wrong place.

Prepend the path that ls removed.

Code:
ls -1rt folder | while IFS= read -r item; do [[ -f $item ]] && { cat folder/$item; stat -c %y folder/$item; } >> /work/scripts/acu/outputfile.txt; done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need to find fifo files

I need to be able to recursively find fifo files in a users home directory. What is the best way to do that. (3 Replies)
Discussion started by: frankkahle
3 Replies

2. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

3. UNIX for Advanced & Expert Users

merge two files in ascending order

Hello Friends, I want to merge two files in ascending order on the first field. And if the first field matches sort on 3rd field i.e, TXADDR should come ahead of RXADDR . file1 9 : TXADDR : 00000000 65 : TXDATA 0000000000000011 83 : TXDATA 0000000000000012 453 :... (10 Replies)
Discussion started by: user_prady
10 Replies

4. Solaris

Program execution order like FIFO queue

Hi all: I have a problem with a C++ service runing on solaris 10. This service only set a signal on oracle table. When the service detect a cut off on the line (tcp/ip), trigger a cobol program for set the signal OFF. When the line is on again, the service trigger the same cobol program for set... (0 Replies)
Discussion started by: hcastellani
0 Replies

5. Shell Programming and Scripting

check how many files in folder or total files in folder

Hi all, I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder? please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies

6. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

7. UNIX for Dummies Questions & Answers

Folder Merge

Hi, I had a folder ABC . Was trying to move it . But the command was randomly stopped by mistake. Now , I have folder ABC in 2 location with different half data at each path . How do I merge both the folders and sub folders into a single one ? Any help is appreciated. (2 Replies)
Discussion started by: Abhayman
2 Replies

8. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

9. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

10. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
MENU_DRIVER(3)						   BSD Library Functions Manual 					    MENU_DRIVER(3)

NAME
menu_driver -- main menu handling function LIBRARY
Curses Menu Library (libmenu, -lmenu) SYNOPSIS
#include <menu.h> int menu_driver(MENU *menu, int c); DESCRIPTION
The menu_driver() function is the guts of the menu system. It takes the commands passed by c parameter and performs the requested action on the menu given. The following commands may be given to the menu driver: Command Action REQ_LEFT_ITEM Sets the new current item to be the item to the left of the current item. REQ_RIGHT_ITEM Sets the new current item to be the item to the rights of the current item. REQ_UP_ITEM Sets the new current item to be the item above the current item. REQ_DOWN_ITEM Sets the new current item to be the item below the current item. REQ_SCR_ULINE Scroll the menu one line towards the bottom of the menu window. The new current item becomes the item immediately above the current item. REQ_SCR_DLINE Scroll the menu one line towards the top of the menu window. The new current item becomes the item immediately below the current item. REQ_SCR_DPAGE Scroll the menu one page towards the bottom of the menu window. REQ_SCR_UPAGE Scroll the menu one page towards the top of the menu window. REQ_FIRST_ITEM Set the current item to be the first item in the menu. REQ_LAST_ITEM Set the current item to be the last item in the menu. REQ_NEXT_ITEM Set the new current item to be the next item in the item array after the current item. REQ_PREV_ITEM Set the new current item to be the item before the current item in the items array. REQ_TOGGLE_ITEM If the item is selectable then toggle the item's value. REQ_CLEAR_PATTERN Clear all the characters currently in the menu's pattern buffer. REQ_BACK_PATTERN Remove the last character from the pattern buffer. REQ_NEXT_MATCH Attempt to find the next item that matches the pattern buffer. REQ_PREV_MATCH Attempt to find the previous item that matches the pattern buffer. If menu_driver() is passed a command that is greater than MAX_COMMAND then the command passed is assumed to be a user defined command and menu_driver() returns E_UNKNOWN_COMMAND. Otherwise if the command is a printable character then the character represented by the command is placed at the end of the pattern buffer and an attempt is made to match the pattern buffer against the items in the menu. RETURN VALUES
The functions return one of the following error values: E_OK The function was successful. E_SYSTEM_ERROR There was a system error during the call. E_BAD_ARGUMENT One or more of the arguments passed to the function was incorrect. E_NOT_POSTED The menu is not posted. E_UNKNOWN_COMMAND The menu driver does not recognize the request passed to it. E_NO_MATCH The character search failed to find a match. E_NOT_CONNECTED The item is not connected to a menu. E_REQUEST_DENIED The menu driver could not process the request. SEE ALSO
curses(3), menus(3) NOTES
The header <menu.h> automatically includes both <curses.h> and <eti.h>. BSD
September 10, 1999 BSD
All times are GMT -4. The time now is 07:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy