• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

How To write a simple bash script for Linux

Please help...

Trying to make short cuts commands to string commnad in Linux.
This is what I did:

nano t1

and saved to it
#!/bin/bash
cp call.bak call.txt
mv call.txt /var/spool/asterisk/outgoing/call.txt

but get error why type t1 and enter
-bash: /etc/asterisk/t1: Permission denied


Please help..
0
shaunwingin
Asked:
shaunwingin
  • 3
1 Solution
 
fosiul01Commented:
you need to give access to it

chmod 755 t1

then run like this from command prompt

.t1  
0
 
fosiul01Commented:
sorry its ./t1
0
 
shaunwinginAuthor Commented:
what does
chmod 755 t1
translate to please
0
 
fosiul01Commented:
by chmod 755 t1
you are giving the script execute permission
0
 
TintinCommented:
755 translates to

7 read/write/execute permissions for the owner
5 read/execute permissions for the group
5 read/execute permissions for others
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now