Write a shell script that will take a filepath and a string as command line arguments. The script should find lines which contain the given 'string' in the given file. It should create an output file in "/tmp" directory with the name in the pattern as below. "NN_15Nov2013_12Hrs_32Minutes_20Seconds.txt"

Re: create a shell script 80 80

Are you asking for help or just the answer? If it is the former please explain what you've tried and how you are stuck.

Re: create a shell script 80 80

From your post it appears that you are running Linux/Unix, right? You are writing a bash script? If this is so, study the bash man page: man bash - that should provide you enough information to get started. We don't do your homework for you, but will help you sort out your problems once you have made a reasonable attempt to solve the problem and write the code.

FWIW (this is a hint), to write the data to the appropriate file name means you need to use the "date" command to format the date+time properly in order to generate the file name, and you will need to understand how backquoted commands work in bash.

Re: create a shell script 80 80

I run following script in windows 7 to update my IP on supplier server, I want to run it on linux console, Will appreciate if some expert can help me.xxxx has been added for security purpose. Thanks.

myURL = "https://unlocator.com/tool/api.php?api_key=fd3b32f53e297ce83151abfd6db781ec0e60a4f1a34642379389bb47e27d8xxxx"

Set req = CreateObject("MSXML2.XMLHTTP.6.0")
req.Open "GET", myURL, False

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.