Question

Hello I need help creating a bash script in linux for the following question: Create a...

  • Hello I need help creating a bash script in linux for the following question:
  • Create a script to expand the jpeg creator to create other types of files such as pdf, png, gif, etc.

The jpeg creator is the following:
#!/bin/bash
FILE=$1
echo -e -n "\xFF\xD8\xFF\xE0"> $FILE
dd if=/dev/random bs=512 count=4 >> $FILE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#!/bin/bash
FILE=$1
#echo -e -n "%PDF"> $FILE #pdf
#echo -e -n "\x89PNG\r\n\x1a" > $FILE #png image
echo -e -n "GIF89a" > $FILE # gif image
#echo -e -n "\xFF\xD8\xFF\xE0"> $FILE
dd if=/dev/random bs=512 count=4 >> $FILE

just uncomment line to generate each individual

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)

Add a comment
Know the answer?
Add Answer to:
Hello I need help creating a bash script in linux for the following question: Create a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello, I need help creating a bash script for the following question, please also show screen...

    Hello, I need help creating a bash script for the following question, please also show screen shot of running the program, thank you for your help in advance Create a script to create files such as jpeg, pdf, png, gif, etc.

  • Hello I need help creating a bash script for linux as shown below getting the information...

    Hello I need help creating a bash script for linux as shown below getting the information from ifconfig The script must programmatically gather and output the informationEXACTLY AS SHOWN BELOW and (not echo this and echo that). ====================================== Interface: AAA MAC Address: BB:BB:BB:BB:BB:BB IP Address: CCC.CCC.CCC.CCC Subnet Mask: DDD.DDD.DDD.DDD Received Bytes: EEEEEE ====================================== Thanks,

  • 1. Install the supplied bash script on the Kali Linux VM BASH filename :ipLAN In text...

    1. Install the supplied bash script on the Kali Linux VM BASH filename :ipLAN In text editor looks like this #!/bin/bash is_alive_ping() {    ping -c 1 $1 >/dev/null 2 >&1    [ $? -eq 0 ] && echo Node with IP: $1 is UP. } for i in 192.168.1.{1..255} do is_alive_ping $1 & disown done QUESTION: Install the supplied bash script on the Kali Linux VM **NOte how do i install the above script in kali ,when i am...

  • Problem 1 Write a BASH script to create a user account from the Linux system on...

    Problem 1 Write a BASH script to create a user account from the Linux system on which your script is run. The script should process two positional parameters. First positional parameter is supposed to be a string with a user name (e.g., user_name) Second positional parameter is supposed to be a string with a user password (e.g., user_password) In your script: Check if two positional parameters were passed to your script when it was invoked If NOT, print an appropriate...

  • Please write a BASH Script in LINUX that... 1. is actually executable 2. has a comment...

    Please write a BASH Script in LINUX that... 1. is actually executable 2. has a comment to tell us what you did, why and how. 3. allows a user to enter their name and a number between 1 than 100 (this must be prompted so the user knows what to do) 4. creates a random number between 1 and 100 for you to guess. The command to create a random number is shown below. (if you find a better one...use...

  • Hello, I am attempting to write a basic shell script using bash. It will need to...

    Hello, I am attempting to write a basic shell script using bash. It will need to print the user, host, time, and date. It will need to take user input for a txt file to be searched and create a new file to save the results. It must print the number of lines and characters in the text. The user will need to enter three words to be searched, and the number of occurrences of those words in the text...

  • Copy/Paste your script from 5b here. 4. Let's look at a more complicated script executable. a....

    Copy/Paste your script from 5b here. 4. Let's look at a more complicated script executable. a. Write the following as script6.sh and change its permissions to count for num in d do if num eq 100 then count (count+1) done echo The number 10 was found $count times What is the output? Run the script as ./script6.sh 10 20 30 10 40 20 50 10 60 <enter Summarize what the script does r using the read command. The following script...

  • 5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permi...

    5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permissions testdir/testdir_1/file1 where owner has read and execute permissions testdir/testdir_1/file2 where where owner has read, write and execute permissions. Group has read only permissions 7. Create a directory called newdir/newdir_1/newdir_2 copy the file testdir/testdir_1/file1 to this directory Change the permisions of the file to owner,...

  • Create a bash script to do the following on your CentOS6 VM. To back up your...

    Create a bash script to do the following on your CentOS6 VM. To back up your home folder using tar command daily. Use gzip as the compression for tar (z option). – 10pts Hint: Make sure you exclude the tar file itself from the backup. The script should name the tar file backupYYYYMMDD.tar.gz -10 pts The script should keep the last seven days of backup files and delete backup files older than seven days. -10 pts The script should check...

  • Objective : Write a C Shell script which copies all files(*.java and *.class) from your home dire...

    Objective : Write a C Shell script which copies all files(*.java and *.class) from your home directory to a new one, and Analyze the new directory information such as number of files, user permissions, and disk usage. Sample Output:                                                    << CS Directory Analysis >>      Date:   ============================================================ Current Directory: /home/tomss New Directory Created : /home/tomss/pgm01 File information Total Number of files : 22 files Directory files:   0 files Plain text files:   10 files File have read permissions: 3 files File have...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT