Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if a folder exist in awk...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi!
It's me again...

I'm writing a script in nawk that does changes to a bunch of files and then sorts them into folders depending on their contents. I'd like to check if a certain folder exists, and if not create it.
But is it possible to determine the existance of a folder from an awkscript using system() or something like that,
or do I have to call a shellscript to do this?

Thanks in advance.


- Tobias
(tobbe_snodd@hotmail.com)
 

system( "test -d yourfolder" )


if system returns 0 the folder is there


Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top