Creating a file but with an specific name

So I have a project which needs to create a list of numbers which then will be sum all together and more, but right now, one of my problems is that that I need to give the user the option to decide what the name of the file will be, so I have a very little knowledge of unix so help would be good

  1. usr/bin/bash
  2. clear;
  3. echo enter name
  4. read v
  5. cat > v

this is what I have, it's creating the file but as you can already tell, the file name will be v; any thoughts on how I can fix this code?

0

1 Answer

#!/bin/bash
clear
read -p "enter name" v
echo "Beginning" >$v
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like