A shell script is a script written for the shell, or command line interpreter, of an operating system.
0
votes
0answers
7 views
Queue commands in top shell even if one of them launches new shell
I want to automate something writing simple script launching consecutively few scripts one after another. And then setting some aliases at the top shell.
Problem: few of these commands launch new ...
0
votes
1answer
14 views
SSH and SCP giving error
I am doing the same steps (Perform SSH and SCP Without Entering Password on openSSH). But it keep asking password prompt while scp or 'ssh -l' command run. Same steps i did few days back, it was ...
0
votes
0answers
25 views
Auto backup photos to network drive
My wife's ultrabook is getting full of pictures. I have a NAS that all our pictures are on. What I want to do is store EVERY picture on the NAS (easy) but keep all the photos from the last 12 months ...
-2
votes
1answer
33 views
Merging two folders with the same or different names
How can I merge two folders with the same or different names with subdirectories, using shell script or terminal. Also, if there is a file with the same name, then it should skip.
0
votes
1answer
26 views
Can you switch into Single User Mode Without Rebooting?
Is it possible to switch into single user mode WITHOUT rebooting and holding CMD+S.
For example, can I write a shell script to switch into single user mode?
If so, for which operating systems?
1
vote
2answers
73 views
How to rename to existing folder
i am not able to rename the folder name. i tried these ways. please correct me,
[testuser@backupdev1-lnx backup]$ cd /opt/backup/
[testuser@backupdev1-lnx backup]$ ls -l
total 8
drwxrwxr-x 2 ...
0
votes
0answers
12 views
How can i automate attaching log files in SBM serena business manager SCR tickets
I have to automate the following task.
Using a script, I want to automatically attach a file to SBM Serena Business Manager's SCR ticket's ATTACHMENT section --or update other infomation in SCR like ...
-1
votes
1answer
18 views
How to perform zipped mirroring on Windows?
My source is a directory hierarchy. I need to auto-copy the files in the source to a destination directory, but to have each file individually zipped inside the destination sub-directories. ...
0
votes
0answers
33 views
Commands inside shell script can't be found [closed]
I am taking my first steps in shell scripting with CygWin thus, I would be grateful for understanding.
I am trying to execute my first script (called "script1"). When I type the command "sh script1" ...
-6
votes
0answers
35 views
Explain Line which are in BOLD font dgsh file is like terminal. dgfs is file like in bin folder. if You have need these files, i can send [closed]
!/bin/sh
export DYLD_NO_FIX_PREBINDING=1
export DYLD_BIND_AT_LAUNCH=1
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices
TERM=$(tset - -Q); export TERM
export ...
0
votes
1answer
35 views
Launching a Shell Script via .desktop in Raspbian Wheezy
I am trying to launch OMXplayer and play a sequence of videos on loop on a RaspberryPi running Raspbian Wheezy. I have got a working shell script which launches and plays the videos courtesy of ...
1
vote
1answer
28 views
bad interpreter shell script
Hi I'm trying to write a shell script for plotting with gnuplot however I keep running into the error: bash: ./plot.sh: usr/bin/gnuplot: bad interpreter: No such file or directory
I have checked the ...
1
vote
2answers
46 views
Averaging subsets of images with imagemagick, iteratively
I have a hundred images and I want to average them 5 at a time.
The imagemagick command for the first 5 is:
convert -background transparent %d.jpg[1-5] -average output1.jpg
The imagemagick ...
0
votes
1answer
25 views
Script to copy files to x locations of rules are met
I would like to create an automator script that will ask me for a specified folder, and on selection I would like it to search for the following and do x tasks
if files is .mkv and does not contain ...
0
votes
0answers
17 views
Script to make and replace files [duplicate]
How can I make a shell script that creates a directory and a file everytime it is run and then replace the previous files?
I am reposting this because the original post got closed because of the ...
-2
votes
0answers
38 views
Using a shell scripts to create and replace files [closed]
How can I make a shell script that:
Creates a directory sampleDir and will create empty file "a" in it.
Second run of the same script will result in renaming sampleDir into sampleDir.000 and ...
1
vote
3answers
47 views
Linux tool to autodownload and build from SourceForge?
Has anyone made anything (even just a script) to automatically download, untar, and make projects off of SourceForge in Linux? How could I do that?
I am using Ubuntu 12.10, specifically.
0
votes
4answers
46 views
Is there a cross OS (win/mac) scripting languagee? [closed]
I use Autohotkey for all my Windows scripting, but would like to use something that could apply to a Mac as well. Without having to write it in multiple languages. And having it compatible with ...
-2
votes
2answers
40 views
How to run apache server if it not already running
I wonder if it is possible to check whether or not apache2 is running. If it is not running I want to execute it using shellscript
Currently I have added a function which I named run_apache which ...
0
votes
0answers
19 views
Loop through folder with higher space usage in shell? [duplicate]
I would like to create an script where give me a report of which folders have the higher usage space and keep doing that until there's no folder anymore.
Today I do this manually, with:
sudo du -h ...
1
vote
4answers
134 views
parse log file with heavy output
I'd like to monitor my vsftpd logs and pull information from the logs to process the files that have been uploaded. Up till now everything was great and worked fine:
tail -n0 -F /var/log/vsftpd.log | ...
0
votes
1answer
26 views
parse vsftpd log with shell script
I try to parse this line with vsftpd:
Sun Apr 7 07:23:33 2013 [pid 23590] [cam02430] OK UPLOAD: Client "206.132.183.209", "/20130407/07/20130407_072324D.avi", 496846 bytes, 383.38Kbyte/sec
with:
...
2
votes
2answers
66 views
multiple conditionals in shell script
This is driving me insane. There are many posts on this but nothing is working for me. I want to check if a file is not an avi or mpg then I want to exit. Here is a simple example:
#!/bin/sh
...
2
votes
2answers
48 views
Exclude files in a for loop
I want to delete the /lib directory inside apk files. I managed to do this with:
for DIR in ~/ABC ~/ABD
do
cd $DIR
for APK in *
do
if test -f "$APK"
then
zip -d $APK ...
1
vote
1answer
49 views
Comparing zip files
We need to compare the contents in each of 2 .zip files we have.
Each .zip file has of different file extensions. Each .zip file also contains another .zip file and a couple of subdirectories.
We ...
0
votes
1answer
39 views
how to compare negative floating points in bash
We tested our script and it fails on negative floating points comparison in bash.
What are we doing wrong ?
$F1=10000000000
$F2=300
FLP=$(bc <<< "scale=5; ($F2 - $F1)/$F2 * 100")
if [ $FLP ...
1
vote
1answer
53 views
Shell script detecting errors from command called by script
I am calling applications from my shell script, which performs a number of important steps in sequence, one step being below:
for database in $(
echo 'show databases;' |
mysql ...
0
votes
2answers
62 views
*nix shellscript: Get disk usage on multiple OSs
I am trying to get the usage-percentage for a given disk in a system. The program I have to write will be a bash shell script. The script has to work on Debian, Arch, and Mac OS X.
My current ...
0
votes
0answers
34 views
maintain a fixed number of files
We have a linux directory where files and directories are being added to it daily.
We like to control this list of files and subdirectories in the directory by fixing the list to 50 most recent files ...
2
votes
1answer
58 views
How to find all zero byte files in directory
How to find all zero bytes files in directory and even in subdirectories
i done this
#!/bin/bash
lns=`vdir -R *.* $dir| awk '{print $8"\t"$5}'`
temp=""
for file in $lns
do
if test $file = "0"
then
...
-1
votes
1answer
82 views
Calculate % difference and file sizes between two files
We have two zip files and would like to compare them.
We're also interested in calculating the percentage difference between them and the file size.
Is there a tool that can do this quickly?
1
vote
3answers
50 views
Using Xargs with hocr2pdf
I'm trying to use tesseract and hocr2pdf on a series of .tif files in a folder.
Using ls *.tif | xargs -I% tesseract % % -l fra hocr produces the html files which have the same file name but with ...
2
votes
1answer
49 views
wget downloads empty files even with proper referer and cookies
I'm trying to scrape Brenda Enzymes for a bunch of molecule files with a script. If I just download by file URL (it's a PHP redirect), I get a 0Kb file, so I think they're checking for cookies and/or ...
0
votes
0answers
158 views
Automator and /bin/bash Shell Script
I have the following /bin/bash script in terminal (labeled purge.sh)
#! /bin/bash
# cleaning up and being paranoid
x=`/usr/bin/osascript <<EOT
tell application "Finder"
activate
...
-1
votes
1answer
194 views
copy last modified files and folders using batch script from one location of server to other [closed]
@echo on
set SOURCE=\\sourceservername\c$\temp
set DESTINATION=\\destinationservername\c$\temp
xcopy %SOURCE%\* %DESTINATION%\* /s /e /i /Y
PAUSE
I want to paste last modified file from ...
0
votes
0answers
58 views
Rotate Outgoing Ip in Postfix, script not working
I've found what it seems to be a nice piece of code meant to rotate postfix IP but I really can't get it to work. when I run it I get this error:
rotate_postfix_ip.sh: 2: Syntax error: "(" unexpected
...
-2
votes
1answer
91 views
How do I make a batch file that looks exactly like a command prompt?
I want to make a batch file that, when run, looks and works exactly the same as a command prompt, except that I can do something with everything the user enters (e.g. logging it). How can I do this?
1
vote
2answers
59 views
comparing two directories and getting the output with absolute path
was trying to compare two directories. one directory is the reference directory(dir1) and the other is the directory where modifications(dir2) are being done
I need the list of files which are ...
0
votes
1answer
40 views
Remove IP with ip command in linux
If I add two IPs like this:
ip addr add 1.1.1.1/24 dev eth2
ip addr add 1.1.1.2/24 dev eth2
and then I try to delete one of like this:
ip addr del 1.1.1.2/24 dev eth2
BOTH IPs will be deleted ...
0
votes
1answer
59 views
bash call command on $var value
I am new to shell scripting and stepped through this quick guide:
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
which was helpful but left a lot of questions about working with variables ...
0
votes
1answer
96 views
Shell Script : How use find expression in a for?
I would like to use the find command in a for.
So I did this:
for logs in `find $BACKUP_FOLDER -exec ls -la {} \; | awk '{ if ( $8==2011) printf $0"\n" }'`; do
// some command here
done;
But it ...
0
votes
2answers
71 views
How to SSH multiple service with a for in SHELL?
I would like to access some server via SSH, run some commands and exit. Do this for lots of servers.
I know I can do this for one machine only, with this script :
ssh **IP** << EOF
chown -R ...
0
votes
1answer
59 views
Control awesome window manager from console
I would like to accomplish the follwing:
determine current tag X in awesome window manager
sleep for 10 seconds
Jump to tag X no matter what the current tag is.
I know i can control awesome via ...
0
votes
0answers
73 views
Changing character encoding via Shellscript with TextExpander [closed]
Introduction
I'm learning how to type with LaTeX and I've found that the character encoding is very important to get good results. I find myself copying parts from pdf documents such as problem ...
0
votes
2answers
40 views
Execute a command with parameter each filename in a folder
I would like to execute a command, let's call it abc and add as a parameter each filename in the current folder. How could I do this in C Shell (or other scripting language)?
0
votes
1answer
66 views
zsh - variable assignment isn't working
I have this line in a function I'm adapting from a bash function into zsh function:
local info=( $(command df -P $fs | awk 'END{ print $2,$3,$5 }') )
Whenever I call it in the func I get this:
...
1
vote
2answers
88 views
How create a service correctly?
Here it's what I do:
1) create an user some_deployer
2) then create a folder to script like /company/script/<service name>
3) in this folder I create the start.sh and stop.sh scripts and ...
2
votes
2answers
240 views
Renaming multiple files which match UNIX find keyword
I have the following output from find command for finding files containing yyy in name:
./plonetheme/xxx/yyy-logo.png
./plonetheme/xxx/profiles/default/plonetheme.yyy_various.txt
...
0
votes
1answer
36 views
two crons not running simultaniously? [duplicate]
MAILTO=""
*/10 * * * * /bin/bash /var/www/sym_monitor/sym_start.sh > /var/www/migrate/root_start.txt 2>&1
*/10 * * * * /bin/bash /var/www/sym_monitor/stop.sh > ...
0
votes
0answers
12 views
shell script not running the other script inside it [duplicate]
#!/bin/bash
value=$(</var/www/sym_monitor/man.txt)
if [ "$value" == "true" ]; then
ps -ef|grep sym |grep -v grep |awk '{ print $2 }'|sudo xargs kill -9;
cd /var/www/symmetric-ds-3.1.6/bin;
...



