Hello I'm doing a script for doing backups but i can only backup directories from / any other files for example /etc/X11 cannot be backed up. how do i solve this?
this is the code i'm using now:
#!/bin/bash
clear
read -p "Enter the directory to backup:" DIRECTORY
echo
echo "backing up $DIRECTORY"
1. The problem statement, all variables and given/known data:
write a script in language shell bash, which produces the application specified command to all regular files in a given directory (and all subdirectories)
Input parameters:
- Defined directory;
- Given command.
2. Relevant commands, code, scripts, algorithms:
3.
I am trying to give the option to the users to run the script in a different directory. However when the script changes the directory, the mkdir does not work.
I change the directory like this:
case $1 in
"-d")
PWD=$2;;
*)
;;
esac
but when I run the script, it runs in the directory that it exists.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
A script that takes any number of directories as command line arguments and then lists the contents of each of these directories.
Hey guys, I was wondering if any linux gurus could help add zenity to a script. If anyone could show me what the script below would look like with zenity added to it would be greatly appreciated.
#!/bin/bash
dvdencoder=./dvd-it-encode.sh
if [ $# -lt 3 ]
then
echo \
echo Insufficient arguments.
Running kile 2.1 on kubuntu, kernel 2.6.32-45-generic.
Always viewing pdf output in okular.
kile was running smoothly for a long time. With last set of updates, kile does not build PDFlatex anymore.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1.
Hey , guys I am new to shell programing ,, so need a help from you guys ...
I have to write a shell script that accepts file name or directory name from the user if it is a directory then throw an error if it is a file then give the user two options .
1.overwrite the content
2.append the content
Here is my program ..
I understand that one technique for dealing with spaces in filenames is to enclose the file name with single quotes: "'".
Why is it that the following code called, "echo.sh" works on a directory containing filenames with spaces, but the program "ls.sh" does Not work, where the only difference is 'echo' replaced with 'ls'?
echo.sh
#!/bin/sh
for f in *
do
echo "'$f'"
done
Produces:
'a b c'