• Post Reply Bookmark Topic Watch Topic
  • New Topic

Read directory and add to list N create tar file  RSS feed

 
Raj Mama
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
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!