0
votes
1answer
13 views

Backing up recursively is not copying directories

I have the following line in a script to backup and it is not recursively copying all the directories, it gets the files but just lumps them all together. Can anyone tell me what is wrong with it? ...
1
vote
1answer
33 views

linux: monitor logfile for a string and execute script

I want to monitor a logfile (syslog) on my linux debian box. So if there is a new entry with a secific string, i want to execute a script. The strings are "alarm start" and "alarm end" So it should ...
0
votes
0answers
24 views

Bash Script Display Remote Screen Session to User

I'm kind of new to bash scripting and I'm having trouble figuring out how to accomplish this. I'm working on a script that is designed to backup and manage a java application that runs within a ...
-4
votes
1answer
49 views

Can someone help to make this script [closed]

Can please someone help me to make script for multi screen command at startup here is what it is cd /home/bhop1/serverfiles screen ./srcds_run -console -game cstrike -tickrate 100 -pingboost 2 +map ...
0
votes
1answer
21 views

Trace web redirection in bash script

I want to make a script to download the image at best resolution (not the preview image) from a deviantART link, as if I clicked the "Download" button. However, it seems that deviantART redirect the ...
0
votes
1answer
17 views

Renaming files in a folder (and subfolders) by removing a token in filename

I have a huge amount of files in a folder (and subfolders) that I need to rename. For example, I have: movie1.mp4 fixed_movie1.mp4 ... What I need is to rename fixed_movie1.mp4 to movie1.mp4 ...
2
votes
2answers
38 views

Looking for a way execute a task on all files in a directory (recursively) on Windows

I have a huge number of mp4 video files that needs to have a volume boost. I need a way to execute a ffmpeg audio filter on all files in a specified base directory (and in subdirectories as well). My ...
0
votes
0answers
14 views

Make a script identify DBUS session address and use it

I'm using cron with notify-send to display some notifications, but it requires DBUS session to run Here is the script: export DBUS_SESSION_BUS_ADDRESS=[session] #!/bin/sh { DISPLAY=:0 ...
-1
votes
0answers
28 views

Bash Syntax, While Loop. User Input

I have a problem with some Bash syntax. I want to read User Input while that User Input is not Y or N. this is the code i have; read input while [ $input <> "N" ] || [ $input <> "Y" ] ...
0
votes
1answer
53 views

script to delete duplicate files using md5

I want to write a script to find duplicate files in a given directory and delete the copy depending on the hashcode. When I run the script it deletes the copy and the original file. Here's my code: ...
0
votes
1answer
27 views

How to use find to fill in variable in Shell script

I am making simple Shell script form some boring-ever-repeating job. Script changes directory correctly, and now I want to run other scripts based on argument I typed when running script. Other ...
0
votes
0answers
15 views

Look for app/cache and app/logs directory and apply rules in /var/www/html

I need some help creating some bash script that help me on my development server by running this commands: HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | ...
0
votes
0answers
13 views

Run a service action with a file from a shell script

I use CloudApp and it has installed a handy service called “Upload to CloudApp”. I'm writing a build script that I want to hook into this service. Every time it is run I want it to upload the file ...
0
votes
1answer
36 views

running for loop - but wait for string of words in log file to continue

so far I have this: for each in {01..10} ; do ./sb0$each/tomcat_sb0$each start;done that will start my apps at once, but I want it to wait until it reads one line in a file, what's the easiest way ...
0
votes
2answers
43 views

Making PS1 prompt refreshable

I want my prompt to be changed based on an output of a certain command. and based on the command result to add a color. example: run the command: cphaprob stat | grep local | awk '{ print $NF }'` ...
0
votes
1answer
63 views

Running a script from ssh, logging out and continuing the script

The overall question here is - how do I automate sshing into a machine, running a script, and exiting without killing the script? I know that this has been answered several times, but I'm not having ...
1
vote
1answer
34 views

How do I identify shell script execution vs dot execution

I'm writing a bash script that needs to run on the current process for it to be useful. That is, I want to make sure that the script was invoked with source script.sh or . ./script.sh and not ...
0
votes
1answer
70 views

How to extract the filename without the extension from a full path?

I'm trying to right my first bash script, and at one point a filename is passed to the script as $1. I need to extract the file name without the extension. Currently, I'm assuming that all extensions ...
3
votes
1answer
99 views

#!/bin/bash -e :: what is `-e`? other arguments?

I am a shell script coder that always opt to use shell as top level as part of my belt in creating website apps on the fly and have relied on my bash scripts if I want a project to be implemented ...
0
votes
2answers
129 views

Creating a simple custom apt-get/config script

As I play more and more with Ubuntu, I'm starting to see how I can automate the majority of the repetitive commands that I perform whenever I reinstall the operating system. Thus far, it's just one ...
0
votes
1answer
91 views

VLC bash transcoding script destination directory

Well, I have such transcoding script: #!/bin/bash acodec="vorb" arate="256" ext="ogg" vlc="/usr/bin/vlc" fmt="mp3" for a in *$fmt; do $vlc -I dummy -vvv "$a" --sout ...
0
votes
1answer
62 views

input from shell in bash script

i have a bash script i would like modify to support input from shell atm i have to type the link after i have run the script wiak@test:~$ scripts/lget.sh gimme cookie! ...
12
votes
8answers
995 views

Bash Script to repeat every word in a line?

I have a string like: dog cat bird whale And I want to get dog dog cat cat bird bird whale whale All the words are in the same line. Any idea?
0
votes
0answers
42 views

automatically prepend variable in for loop without having to put variable on each line

Is there a way to automatically have the $i variable prepended to the beginning of the command without having to specify it each time? Here is my current script. #!/bin/bash for i in "command ...
2
votes
2answers
49 views

quotes around filenames confuse bash script

I am writing a script that applies a command to loads of files. The way I automate this boils down to #!/bin bash for in_file in ${PWD}/*/*/*.txt; do out_file="${in_file//in/out}" ...
1
vote
3answers
46 views

Is there a tool that could help me use my Linux scripts in Windows? [duplicate]

I am new here. I would like to know if there is a tool that would help me use my Linux scripts in Windows? I am more comfortable with Linux commands than Windows. I also tried to download a software ...
1
vote
3answers
184 views

Tool to record an interactive bash session to shell script

Is there a tool to record an interactive shell session to a shell script? For example if we entered in a terminal: interactive2sh reconfig_foo vim /etc/foo.cfg ibar^ESC:q /etc/init.d/foo restart ...
1
vote
0answers
182 views

find command with exec sh doesn't work in shell script but in commandline (raspberrypi)

I want to find "old" folders in /volume1/photo/ipcam which are named like "????-??-??" and move corresponding folders within dropbox (with the same directory structure /ipcam/...) to the subfolder ...
1
vote
1answer
187 views

How to create destination directory structure dynamically when using mv with wildcards in bash?

I'm pretty new to BASH scripting and I'm looking for an elegant way to solve my task: In a given directory certain files regularly have to be sorted into subfolders. The name of the files has a fixed ...
0
votes
1answer
56 views

Check for syntax of BSUB in bash script

I am trying to submit a job via bsub linux utility using this bash script titple launchparse.sh: #!/bin/bash #BSUB -W 80:0 #BSUB -R rusage[mem=4000] #BSUB -J "myarray[101-150]" ...
-1
votes
2answers
52 views

Is Dropbox a good place for my shell scripts? [closed]

I know the "official" place for my own shell scripts is the $HOME/bin folder. But i would like to use a Dropbox folder instead and then just simply append it to my $PATH. Something like ...
0
votes
1answer
64 views

Log IP address obtained by DHCP Server-Ubuntu Desktop

Would there be a way I could write a script that records the dhcp IP's that the computer running Ubuntu obtains everytime it obtains a new IP?
0
votes
1answer
59 views

Bash two text files comparision script

Given two files, I want to write a shell script that reads each line from file1 and checks if it is there in file2. If a line is not found in file2 it should keep it lets say in a table TAB1. Also, if ...
0
votes
1answer
92 views

Simple bash gpg update script

I have a text file in which I save all my important personal data like all my accounts' passwords and my credit cards' PINs in case I forget those. Obviously, that file needs to be encrypted, so I ...
0
votes
0answers
66 views

Script bash start new process

Every time I run a bash script or a binary, it creates a new process and a messy display, the output text comes only when the process is done. I don't understand why it behaves this way, I would like ...
1
vote
2answers
105 views

How to log output of a part of a shell script

I'm looking for a concise solution for logging the output of a part of a shell script to a file. Additionally, I still want to be able to follow the life output on screen. From the man pages of ...
0
votes
4answers
208 views

ubuntu script no such file /etc/init.d/ script

i'm trying to run this script at start up but this is constantly giving me error that /etc/init.d/put_ubuntu_users: 14: /etc/init.d/put_ubuntu_users: cannot open ~/data.txt: No such file This is my ...
0
votes
0answers
53 views

Linux flow control exit or break on condition

I have a query about the following flow control. I need help to run a script that has these three conditions: Conditions: Successful: Proceed to read message. Fails: Exit to cat or just exit ...
0
votes
1answer
57 views

I do not understand -printf script

I have taken over the responsibility of RHEL5 scripting and I've not had any training in this platform or bash scripting. There's a script that has multiple pieces to it and I will ask only about the ...
-1
votes
1answer
121 views

How to allow user to input file names in bash script

I've got this script I called it "r1": for f in "$@" do fpath=`dirname "$f"` file=`basename "$f"` arc=$fpath"/"$file".rar" rar a -v1024000 -r -m0 -ep1 -o- "$arc" "$f" done It works well but I am ...
1
vote
1answer
234 views

What is the easiest way to turn a list of music files into a playlist

I recently switched from windows to linux and the player I was using in windows stored the rating for flac files inside an id3v2 files which clementine, my preferred linux media player, cannot read. ...
0
votes
1answer
95 views

How to transform a csv to combine matching rows?

I have a CSV file with some transaction data. Let's say date, volume, price and direction (sell/buy). Additionally there is a ID for each transaction and on each closing transaction (the newer one) ...
1
vote
4answers
868 views

Linux: Run command on a batch of files, with matching output files

A simple task: given a directory of files and a command that takes one file as input and produces one file as output, I want to process all the files in a directory at once and output them with ...
1
vote
1answer
551 views

wget execute script after download

I need every time you complete a transfer program wget this run a script. this is my full command line: wget -i urls-to-downloads.txt My problem is that I want to go subtracting it downloads the ...
0
votes
0answers
34 views

Making the 'script' log pretty [duplicate]

I often use the 'script' command in the terminal (on OSX) to keep a note of what I'm doing. However the script files generally look like: Script started on Wed Oct 2 11:12:24 2013 ...
0
votes
3answers
173 views

Write pipe result to variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
1
vote
0answers
40 views

Script to port specifc data from doc1 (notepad++) to specific place(s) in doc2

I really appreciate your help with a windows script or regex function that ports specific data from doc1 (xml in notepad++) to specific place(s) in doc2 (notepad++). I'm running win8. Thank you in ...
2
votes
1answer
64 views

How to properly restore settings when running a script using “source”?

I'm writing a script that needs to be executed using source, because its task is to modify the environment. During the script, I want to use set -e so that any error stops the script. The script looks ...
2
votes
1answer
114 views

How can I attach a cygwin script to a keystroke?

I have a script that needs be launch through Cygwin with the following execution /usr/bin/bash -lic "/home/userdude/scripts/scrypty.sh param1 param2" How would I go about setting up a keyboard ...
1
vote
1answer
225 views

Split window programmatically with iTerm?

on my development workstation I often have to start the same commands every morning. zeus start, zeus server (booting rails via zeus), redis-server, and like 3 others. I know a lot of people would ...