Posts

Showing posts from March 14, 2019

Shell script won't reading non- .sh files [duplicate]

Image
Clash Royale CLAN TAG #URR8PPP 0 This question already has an answer here: Read a line-oriented file which may not end with a newline 6 answers #!/bin/bash while read p do echo "$p" done < numbers.txt This script is only reading and allowing me to print .sh files. I have tried it with .txt files (like above but it does not print anything.) shell-script share | improve this question edited Feb 18 at 19:34 Cesa Salaam asked Feb 18 at 19:18 Cesa Salaam Cesa Salaam 1 1 marked as duplicate by Kusalananda  shell-script Users with the  shell-script badge can single-handedly close shell-script questions as duplicates and reopen them as needed. StackExchange.ready(function() if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() var $hover = $(this).addClass('hover-bound'), $msg = $hover.siblings('.dupe-hammer-message'); $hover.h

Trying to execute a script (that creates folders) on remote server: “Permission denied”

Image
Clash Royale CLAN TAG #URR8PPP 0 I wrote a very simple script that should allow me to create directories with specific permissions on a remote server. I used the command to execute the script to the remote server: stan@192.168.159.133 /root/Documents/script And I got this answer: bash: /root/Documents/script: Permission denied Connection to 192.168.159.133 closed. I'm working on Fedora 20, and the server is on Ubuntu 18.04.1. I tried to modify the permission on my script document with chmod: chmod 777 script At first I tried to execute the script with the SSL connection integrated inside of the script (you can see it in my script). #!/bin/bash #Connecting to Ubuntu Server #ssh stan@192.168.159.133 #specifying the directory where I want to create my two directories cd /home/stan #Creating the first directory "PublicFolder" and assigning permissions mkdir PublicFolder chmod -R 606 PublicFolder #Creating the first directory "PrivateFolder" and assign