Fedora :: Dong Some Scripting V. Name That Command?

Oct 10, 2010

trying to execute a command and it's arguments in a new gnome-terminal window...

...but i don't want the parent program to wait for the new process to end.

-e and -x don't seem to accomplish this...

View 4 Replies


ADVERTISEMENT

Software :: Scripting : Using A Variable In A Command?

Jan 13, 2009

I need to create a zip file of jpg and bmp files. The zip file is named after the first file it finds which ends with .dat. Here is my script:

Code:

DAT_FILE= `find . -maxdepth 1 -iname "*.dat" | head -1 | sed 's/..(.*)..../1/'`
(cd pics; find . ( -name "*.bmp" -o -name "*.jpg" ) -print | zip ../$DAT_FILE -@ )

BTW my sed command cut off the first two chars and last four chars since find will return the filename is the form of "./filename.dat" and I just want to extract filename. When I run this script, it creates a zip file named ".zip". How do I fix this so the zip file is named after my dat file?

View 3 Replies View Related

Programming :: Exec And Ssh : Command In Scripting?

Aug 4, 2010

I am a newbie, I am writing a script file to execute some programs.

# ! bin/ bash

clear

echo "*************************************"
echo " ACOUSTIC MODELLING - BELLHOP "
echo "*************************************"
#exec ssh automatix
code....

problem 1 : I can ssh to the required space but after the terminal prompts me for password it stops ececuting the script.

problem 2: after performing the 'exec' command for the first time. its not executing anything after that line. is there any work around for this.

View 1 Replies View Related

Ubuntu :: Shell Scripting Command Doubt?

Jan 1, 2011

How do i find out if a particular item is a file or a folder through the terminal ls -la gives 'd' before the permissions for every folder and '-' before every fileLike i want to write a script that backup data if it is a folder and deletes if it is a file

View 2 Replies View Related

General :: Bash Scripting / A Command That Can Stop Others?

Mar 31, 2010

i would like to ask something very simple i hope for most off you but i couldn't find anything in other questions so specific...

So...i need a command to stop another command.

more specific i have to run airodump-ng and i want this command to stop after some seconds (or minutes) automatically....

View 6 Replies View Related

Server :: Dos2unix Command In Shell Scripting?

Jul 5, 2011

I am new to shell scripting..I really need ur help or guidance here..I have a text file where i have to use dos2unix command.

Now the problem is how do i pass dos2unix command in the shell scripting after it had read the text file ??
And give out the new text file.

View 3 Replies View Related

General :: Scripting - Clean Up Output Of 'script' Command?

Jan 24, 2011

I'm using the linux 'script' command [URL]... to track some interactive sessions. The output files from that contain unprintable characters, including my backspace keystrokes.

Is there a way to tidy these output files up so they only contain what was displayed on screen?

Or is there another way to record an interactive shell session (input and output)?

View 4 Replies View Related

Software :: Scripting Error - Export Command Not Found?

Apr 1, 2010

I am attempting to create a script for Grid job submissions. I have most of it completed but when testing I've run into some problems.

How it works is that I have 2 wrapper files, one is the top of the script, the other the bottom, the original script imports commands for the middle.

Basically this is what is to happen:
cat script-start.sh >> workerscript.sh
echo commands >> workerscript.sh
cat script-end.sh >> workerscript.sh

workerscript.sh gets created with no problems but when it is run I get:
export: command not found

I think that the new script is not calling bash which gives the problem. I don't know how to fix the problem though because I have the shell set in the script-start.sh.

#!/bin/sh - tried /bin/bash, same result
export PROJECT=/......
export PROJSOURCE=/......

View 14 Replies View Related

General :: Shell Scripting: Parse Parameters From Command Line?

Mar 12, 2010

myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory

Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them?

View 1 Replies View Related

Server :: Shell Scripting Command Line / Getting Error While Passing Parameter?

May 6, 2011

I am very new to shell scripting.How does one pass a command-line parameter to a shell script?for the below program
#/bin/bash
mount -t cifs -o user=ramkannan,password=Linux123@ //10.200.1.125/ramkannan /MT
cd /MT/test
date=`/bin/date "+\%Y-\%m-\%d-\%H-\%M-\%S"`
mysqldump -uroot -pram2@ employeedb > $date.sql
gzip $date.sql

I want to pass parameter for everything,i tried in google and did but iam getting error while passing parameter to all

#/bin/bash
mount -t cifs -o user=$1,password=$2 //10.200.1.125/ramkannan /MT
cd /MT/test
date=`/bin/date "+\%Y-\%m-\%d-\%H-\%M-\%S"`
mysqldump -uroot -pram2@ employeedb > $date.sql
gzip $date.sql

i was getting error while passing parameter to all.

View 2 Replies View Related

Programming :: Shell Scripting Loop Error Yal2361: Command Not Found?

Jul 22, 2011

I have written the following script in my linux server to add users for LDAP database.But i can't able to run this.

The script is as following

#!/bin/bash
echo "Mention the username which you want to convert LDIF format"
read username
if ["$username" -e "/ldiffile/passwd"]; then
echo "Username already exists"
else
cat /etc/passwd | grep -i "$username" >> /ldiffile/passwd
fi
The output which i got :
. ldapadd.sh
Mention the username which you want to convert LDIF format
yal2361
-bash: [yal2361: command not found

please let me know where need to change and what

View 5 Replies View Related

Software :: Scripting Screen Command To Start A Split Screen By Default?

May 27, 2010

I'm trying to use the screen command to start a split screen by default.

I know once I am an in `screen`, I can type C-a S to get a split screen. But is there a way to specify this as an argument to the `screen` command so it starts automatically with a split screen?

View 2 Replies View Related

Programming :: Bash Shell Scripting / Using The Sort Command To Sort The Top 5 CPU Processes?

Feb 28, 2010

What options should I use when I'm using the sort command to sort the top 5 CPU processes (ps -eo user,pid,ppid,%cpu,%mem,fname | sort ??? | head -5) showing max to min usage?

View 2 Replies View Related

Programming :: Firefox Scripting Add-on (Scripting HTML / Javascript Inside Firefox)?

Sep 17, 2009

Is there a firefox add-on to script HTML and/or Javascript directly inside firefox

View 1 Replies View Related

Fedora :: Getting 0 For Both Conditions In Shell Scripting?

Jun 8, 2011

#!/bin/bash
str3=""
if [ -z $str3 ] ; then
echo " $? = $? "
fi

[code]....

output:-

$? = 0
$? = 0

why we get 0 for both conditions? I am using FC15.

View 1 Replies View Related

Fedora :: Shell Scripting / Bash Error Est.sh: Line 9: Kill: (20831) - No?

Jun 11, 2010

I was giving the found the following shell script. I was told it was suppose to ensure only that only one script of Test.sh can run..

However, I get it looks like it has a error when i run it... As i get Test.sh: line 9: kill: (20831) - No such process

what is going on in this script can someone explain it to me... I thought it suppose to work like a singleton for my script creating a file .run-test-sdolan. However, i don't see how or where .run-test-sdolan is create?

sdolan@staging:$ vi Test.sh
#!/bin/sh
MYDIR=`dirname $0`
CONFDIR=$HOME/
code....

View 4 Replies View Related

Red Hat / Fedora :: Fedora Shell Scripting \ "Find In Curent Folder For Files, And It Copy First File He Find With Name Gived By User?

May 18, 2011

shell scripting in Fedora14I want a script"Find in curent folder for files, and it copy first file he find with name gived by user, if name already exist then echo error message and finish"command usage " bash scriptname copyASname"

smthing like Code: #!/bin/bash
for files in /home/user/*
do

[code]....

View 1 Replies View Related

Fedora :: Create A Shell Script File With Two Functions - Bash Scripting & /etc/bashrc

Oct 6, 2010

how come I can create a shell script file with two functions, I can execute the file, but when running declare -f, the functions are not on memory, and when invoking the function bash returns invalid. In the other hand, I can copy & paste the two functions at the end of my /etc/bashrc file.... then I can called the function by name.... and the commands within that function run on my session. here is a print of all my bash packets:

[Code]....

Does Fedora has restrictions on shell scripting? I haven't touch bash in seven years, so if things have change on it I'm behind on it, and sorry for my ignorance.

View 1 Replies View Related

Fedora :: Run Python3 Scripts From Command Line And Call Up Python 2.6.2 Idle With The Command Idle From Command Line?

May 29, 2010

i've gotten my fedora 12 to the point where i can run python3 scripts from command line and can call up python 2.6.2 idle with the command 'idle' from command line. what command will call up python3 (3.1.2 to be exact) idle?

View 5 Replies View Related

Ubuntu :: Sed And Shell Scripting ?

Feb 22, 2010

I have recently put together an install script to make my life a little easier.

The server is using lighttpd and I wish for the auth mod to be enabled.

For the line:

I require the script to call the servers external IP and insert it in place of 127.0.0.1

View 5 Replies View Related

Ubuntu :: Scripting In 10.04 Substantially Different?

Apr 24, 2010

I have a script which I designed on 9.04. It worked for 9.10 and now it does not work on development release. For some reason it only works every 20th time. It will reset itself until it finally works. Then when it does work, the cat command does not process the "/t"s in the code.my script is mythicalLibrarian, you can find references here:[URL]I Need some help. The following code is supposed to auto-install mythicalLibrarian and it works on 9.10, but not on the development release. The following code will create the
following

~/.mythicalLibrarian
/var/www/mythical-rss
/usr/local/bin/mythicalLibrarian

[code]....

View 9 Replies View Related

General :: Need Man Pages For Scripting

Apr 20, 2010

Does anyone know of any man pages that would provide me information on commands in shell scripting like while or case? I have a test tomorrow where we have to write shell scripts and we're allowed to use the man pages, but not allowed to look at previous scripts. I don't feel like memorizing a bunch of commands if I don't have to.

View 5 Replies View Related

General :: What Is Shell Scripting?

Feb 15, 2011

What is shell scripting? what is 'bash'?

View 14 Replies View Related

Programming :: Which Is Best Scripting Language?

Jul 23, 2009

I want to know which is the best scripting language right now and what you guys think its going to be the best or most used in the future, that is, in about 5-10 years. Take into account system administration and applications. This are the languages i had in mind, add more if you think other scripting languages are better or worth considering.

View 14 Replies View Related

OpenSUSE :: Kde 4.5.1 Python Scripting Is Broken?

Sep 3, 2010

Kde 4.5.1 from 03/09/2010 2100h. python-sip is 4.10.xxx and 4.11.xxx is neded to let things work

python-kde4 and python-kdebase4 wont install

nothing provide python-sip - 4.11 needed by python-kde4-4.5.1.168.1-x86_64

View 2 Replies View Related

General :: Ubuntu 10.04 - GUI Scripting Languages

Aug 5, 2010

There is a scripting language made for Windows called AutoIt. It can do things like, for example, if a user highlights a word and presses a certain hotkey, it can copy that word into memory, open up firefox, go to google.com, paste the word into the text box, and click the button to search. What are some of the easiest scripting languages in Linux to learn that can do this?

View 4 Replies View Related

Ubuntu :: Where To Start Learning Scripting?

Jan 5, 2010

I have been using Ubuntu for about a year now, for my Home PC I have completely switched but still have windows on my wife's and work computers. I am in the data storage industry and have a good basic understanding of unix and linux. For my own learning I want to start learning some basic scripting where I can create simple things that make life easier like to become a beginer UNIX or linux admin..what should i start with...I just seem to be so overwhelmed cause there are some many things you dive into..I see so many types of scripting shells I don't know where I should start to learn the basics

View 4 Replies View Related

Ubuntu :: Scripting / How To Make Deb Files

May 9, 2010

Where I can look to find in depth how to make .deb files? and maybe something on scripting with ubuntu.

View 1 Replies View Related

Ubuntu :: Bash Scripting Gives Bad Substitution

Feb 18, 2011

I'm trying to get the substring of a string in bash. Here is the code:
Code:
#! /bin/bash
LOCAL_HOSTNAME=$(hostname)
echo $LOCAL_HOSTNAME
INDEX_OF=`expr index "$LOCAL_HOSTNAME" 1`
echo $INDEX_OF
SERVER_HOSTNAME=${LOCAL_HOSTNAME:0:INDEX_OF}
echo $SERVER_HOSTNAME

It's supposed to get the current hostname, assign it to variable LOCAL_HOSTNAME, get the first occurrence of "1" from hostname and assign value to INDEX_OF, the get the substring from variable LOCAL_HOSTNAME (starting at index 0 through INDEX_OF) and asign it to SERVER_HOSTNAME. No matter how much I've tried it keeps throwing Bad substitution error at the substring. I've searched and it says it has to be bash... but it is bash, both the sh script and the running shell. The LOCAL_HOSTNAME and INDEX_OF variables are ok.

Here is the output:
I've also tried to get the substring without the INDEX_OF but it gives the same error: SERVER_HOSTNAME=${LOCAL_HOSTNAME:0}
Code:
host1
5
test.sh: 7: Bad substitution

View 2 Replies View Related

Ubuntu :: Pointers To Learning Scripting?

Apr 25, 2011

I have a project for my computer class, and I was a bit ambitious with my ideas and am wondering if I made a smart choice. I need to learn sooner or later anyway! I'm a beginner when it comes to scripting but I'd like to learn more advanced stuff. When I say basic I really mean basic among all basic. To give you an idea I only know some simple HTML and Python. The idea I proposed for my project goes as follows:

The challenge we were given is to create a spreadsheet of data from a website given to us. Points are given for creativity and simplicity in how we go about doing this.After taking a look at the site (or rather, html files given to us), and with having dabbled with Python before, I came up with what I thought was a pretty good idea.The pages of the "site" are just numbers. They go from 001-117 .html in terms of filenames. Their source code has some sort of table set up, and the information we are pulling off are easily found by the tags that precede them (the info, btw are the periodic elements).

The tags are pretty obvious, and state pretty much what they are labeling. My python knowledge is almost nonexistent but I figured that would be something Python would be capable of. Why do I post this here? I'm relatively new to Ubuntu too but keep hearing about bash scripts and such. Would this be even better? (Perhaps it's silly but I'd like to use Ubuntu to accomplish this)

Or is there an even better scripting method/language I should be using? Could anyone give me some pointers in how I could accomplish this? I'm really hoping to learn a lot from my first "real" scripting experience!

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved