Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Read directory and add to list N create tar file

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ALL,
I have req, that I need to read one directory, print one by one, ask for "you want add to Tar file" if I enter Y it would be add to tar file,
like this read all files in directory and print file and ask for add to tar or not, if Y add to tar other wise No,

I think first we need to add to list and finally create tar file with all files which we add to list.

Please send me script .

Thanks in Advance

Raj
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far?

Shall it be possible to add subdirectories as a whole/ skip them as whole?


would do the file-iteration, and only show files, not directories.

tar -r adds files to archive - so no need to write to a list.


reads a single character from stdin.
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic