subject

Question : Find files using bash script. Navigate to /scripts directory and create a new file named findJane. sh. Create the text file oldFiles. txt and make sure it's empty. This oldFiles. txt file should save files with username "jane". Now, search for all lines that contain the name "jane" and save the file names into a variable. Let's call this variable files, we will refer to it with that name later in the lab. Since none of the files present in the file list. txt are available in the file system, check if file names present in files variable are actually present in the file system. To do this, we'll use the test command that we practiced in the previous section. Now, iterate over the files variable and add a test expression within the loop. If the item within the files variable passes the test, add/append it to the file oldFiles. txt. My entry in nano is as follows : #!/bin/bash > oldFiles. txt files-$(grep " jane " ../data/list. txt | cut -d ' ' -f3) for i in $files:do if test -e $HOME$i, then echo $HOME$i>>oldFiles. txt; fi done Error message after entering chmod +x findJane. sh and ./findJane. sh: ./findJane. sh: line 3: files-/data/jane_profile_07272018.d oc: No such file or directory ./findJane. sh: line 5: syntax error near unexpected token `if' ./findJane. sh: line 5: `if test -e $HOME$i, then echo $HOME$i>>oldFiles. txt; fi' Appreciate your help thank you!

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
You receive an email from an impressive-sounding stranger, professor alexander rothschild renard iii, president of the american institute for scientific political statesmen. he urges you to vote for his presidential candidate choice. this social media red flag is known as
Answers: 1
question
Computers and Technology, 22.06.2019 16:20
Consider the following statements, then select one of the answers below: the signal() function shown below registers "sig_handler()" as the signal handler function for the sigkill signal, without the complexity of using when the sigkill signal is sent to a process running this code, by a user typing "kill -kill ", where the correct process id is used for to target the process, sig_handler() will be executed.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
You know the right answer?
Question : Find files using bash script. Navigate to /scripts directory and create a new file named...
Questions
question
English, 20.09.2020 16:01
question
Mathematics, 20.09.2020 16:01