Simple Unix Automation

Hi, i'm a newbie with unix and shell scripting. I'm just trying to do a script to simply automate a unix task. This are the steps on what i want to just run on a simple shell script

  1. go to a specific path (cd /folder1/folder2/)
  2. edit and input a number on a file (file_id) then save exit (using vi)
  3. run a korn shell script then once the korn shell script finished running
  4. go to a specific folder
  5. copy a file to a specific folder

can this be automated using shell script? or is there a better way to automate this task. TIA :b:

yes this can easily be automated

you want to edit the file name or the content of the file?
when using vi, it must be the file content, but file id sounds like the name?

what have you tried so far?

i still don't know where to start, file_id is just a sample file name.

1. cd /folder1/folder2/
2. mv File_id1 File_id2
3. /yourscript.ksh
4. cd /specificfolder
5. cp /pathtoyourfile . 

put this commands with your values to a file using vi for example

chmod +x file

start script using

/path/to/file

for example

for more specify more details

just a question about the chmod

for ex. how can i add this number "1122" to the list file "list_number"?

Thanks

I don't see what your question has to do with chmod

chmod 1122 file makes no sense

to add a number to a file, you can use

echo 1122 >> yourfile

perhaps you want to have a look at this:

LSST v1.05r3 > Chapter 2 > How to write shell script

thanks funksen the echo command answered my question.