General :: Pass A Paramter To A List Of Command In Another File?
Apr 19, 2010
I am attempting to write my first ever script from scratch and making some progress.
My first shell script file executes a list of commands contained in a second file. I need to pass a parameter to this command file how do I do this?
View 7 Replies
ADVERTISEMENT
Jan 27, 2011
I have the following char* array
Code:
char* chrarray[] = {"Hello","LinuxQuestions"};
and I need to pass it into a function, how should I define my function in the header file?
[code]....
View 3 Replies
View Related
Jun 9, 2011
I frequently use wget to download tarballs and zip files from the web, then either untar then or gunzip them. I do:
Is there a way for me to automatically pass the zip file to tar or unzip WHILE wget-ting?
In pseudocode: wget google.com/somfile.zip && unzip
View 3 Replies
View Related
Jun 25, 2010
I have access to backup server via rsync protocol (only rsync, nothing else). Now, I want to fetch file from there (which is .tar.gz) and pass it directly to tar command, without saving the archive in local filesystem. To visualize, with ssh access I could:
ssh remote_host cat backup.file.tar.gz | tar xzf - And I will get uncompressed backup locally, without actually storing .tar.gz on local machine. Is it possible to achieve when using rsync?
View 4 Replies
View Related
Oct 30, 2010
With file command we can get the file type. File returns a unique answer for each file type. I want to get the total list that file can return for linux & solaris. For example, I have a partial list of file's return output. Unfortunately I can't see the total list from manual page.
ASCII C program text
ASCII C++ program text
ASCII C program text, with CRLF
ASCII C program text, with very
ASCII English text
ASCII English text, with CRLF line
[Code]...
View 1 Replies
View Related
Mar 19, 2010
How do I list only access time and file name? For example if I do ls -l --sort=time then
[Code]...
View 5 Replies
View Related
Feb 14, 2010
I received the following output from an rsync (3.0.0) command that was executed:
sending incremental file list
sent 77214 bytes received 484 bytes 155396.00 bytes/sec
total size is 254531170 speedup is 3275.90
What does "sending incremental file list" mean?
View 9 Replies
View Related
Jun 20, 2011
How do I pass a list of packages to aptitude so that I can resolve the conflicts interactively?
View 1 Replies
View Related
Jan 5, 2011
when I am running the script below,it performs on whatever logfile u type ,i.e, ./scriptname logfilename.But how do I convert it into a function and then call it from another script.I mean how do I prompt the user to enter a logname and then capture the name in the function and when calling this function from another script how do I pass the parameter.
View 3 Replies
View Related
Mar 10, 2010
I have a backup schedule running a full backup everyday. I'm using webmin to manage these backup now. The problem is when the dump command sends a prompt asking if we want to rewrite the tape, Webmin does not display this prompt and we end up having to terminate the backup -> erase the tape(which takes a long time) and then run the backup again.I was wondering if there is a technique that could be used to pass "Yes" as a parameter to the dump command, much like in windows? or if there is a more efficient way of getting this done.
View 2 Replies
View Related
Feb 18, 2011
How can I pass carriage return to a command. I am writing a shell script whcih generates ssh key pair. It ask for input from user three times. I want to pass carriage return (ie. press Enter button) to this command. Is tehre any way
View 8 Replies
View Related
Jan 28, 2010
one command to list the list of folders/ within the folder.
View 4 Replies
View Related
Mar 3, 2011
I am doing some NSCA log parsing and I want to get an output like this:
2011-Feb-18:11:00:07
2011-Feb-18:11:00:07
2011-Feb-18:11:00:07
2011-Feb-18:11:00:08
2011-Feb-18:11:00:08
[Code]....
I have tried this, but it treats the entire output as a single line, then plops a timestamp on the end (I think):
Code:
sort -b -k4.9,4.12 -k4.5b,4.7Mb -k4.2,4.3 -k4.14,4 foo.log| date -j -f "%Y-%b-%d:%T" "+%s" "`awk -F '[ [/:]' '{print $7"-"$6"-"$5":"$8":"$9":"$10}'`"
View 1 Replies
View Related
Mar 3, 2011
I am doing some NSCA log parsing and I want to get an output like this:
2011-Feb-18:11:00:07
2011-Feb-18:11:00:07
2011-Feb-18:11:00:07
[code]...
View 6 Replies
View Related
Jul 14, 2010
I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program(there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]".Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.?
(Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)
View 7 Replies
View Related
Jun 24, 2011
I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program (there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]". Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.? (Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)
View 8 Replies
View Related
Aug 28, 2009
I have one distro installed, LILO as the boot loader, and i wonder if it's possible to duplicate the lilo entries with an option which executes some script or command during, or after the boot.Actually, i installed a Slackware + autolaunching virtual machine, but i have two VM, so i need to autolaunch one of them. May i choose it from the very beginning ?
View 9 Replies
View Related
Sep 23, 2010
The university I go to uses a WPA2 wireless network that requires a netID and password to connect too. I installed wicd but I can't seem to connect to this network, is there a way to add this functionality to wicd, and if so, how do I do that (links to a how-to or guide would be nice, I've yet to find one).
Also, I spend most of my time on campus in the command line, so I'd like to know if there is a way to use command line utilities to connect to this network (again, a guide or how-to would be nice)
I can get online through my fedora live USB just fine (w/ network manager) but I'd rather get on directly from slackware.
View 3 Replies
View Related
Jul 16, 2011
I am calling a URL from shell script and passing few argumants,Here i have to pass file content as one argument.How can i pass file content through URL.
eg:
content=`cat /Users/test1.txt`
open http://localhost:8080?filecontent=$content
[code],...
View 1 Replies
View Related
Feb 2, 2011
I have a Python script that I run which needs to execute under a special environment, so I would run the program like so from my working directory (~/project/src):
python manage.py shell
This opens up an interactive shell for me to start typing my own commands.I have another set of administrative activities that I would like to house in another directory (~/project/admin). The manage.py is really finicky about running from the working directory. So, to make this whole thing work, I made a script which starts off like so:
#!/usr/bin/python ../src/manage.py shell
There are a couple problems with this. The first is that it doesn't work:
/usr/bin/python: can't open file '"/../src/manage.py" shell': [Errno 2] No such file or directory
How do you specify multiple parameters to the interpreter?How do I change the working directory?
View 2 Replies
View Related
May 2, 2010
I am looking for a clue in shell or ant script, where I excecute a binay file on linux. For example ./myfile.bin which ask me few questions.
./myfile.bin ...........................100%
I would like to automate this process where I want to pass the hostname as a variable or read from a file is it possible? If yes any sample`s on this. I can do if this was a shell script ($1) but not sure when its binary.
View 8 Replies
View Related
May 13, 2011
I made a script to backup file from each host with general password in local network. This script using SSH Pass and Rsync with this
syntax:
rsync --rsh="sshpass -p password ssh -l root" hostath destinationpath
Everything is okay under 9.10 version until I migrate to Ubuntu 11.04, there is always give an error:
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(541) [Receiver=3.0.7]
I am using bash version: GNU bash, version 4.2.8(1)-release (i686-pc-linux-gnu) and 2.6.38-8-generic kernel
View 3 Replies
View Related
Nov 2, 2010
I have run a command which finds a lot of files based on some search criteria. It returns the files like so:
./somepath/somepath/file.something
./asdf/asdf/s.php
./etc/a.php
./a/b/c/d/e/f/g.jpg
So I was wondering, if I capture this output into a file (ie. one file per line), can anyone help me write a command which iterates through the file and moves the files one by one to a specified directory?
View 3 Replies
View Related
Apr 2, 2011
i know that there is already a command for it but it comes out with a lot of letters that makes it hard to find the services that are runningi'm talking about services like DNS, APACHE, DHCP, SAMBA, SSH etcis there a command that will list these services and related services that are running instead of showing a bunch of jumbled and lettered mess thats hard to comprehend
View 6 Replies
View Related
Feb 15, 2010
How can I know how many shells my system support (Is there any specific command)?
View 9 Replies
View Related
Aug 4, 2010
I am very new to Linux and Unix. Is there a command list which indicates the UNIX command equivalents also?
View 5 Replies
View Related
Dec 23, 2010
I have the following code :
Code:
E_BADARGS=65
if [ $# -ne 2 ] ; then
[code]...
View 1 Replies
View Related
May 28, 2010
Are there Unix/Linux commands to find out the IP address of running computers on LAN?
View 4 Replies
View Related
Jun 7, 2010
I need to figure out a bash command to list all users logged in at or after 5pm - 5pm being the specifier in the command.
Code:
Command seems to be the easiest way to display users but it specifies all users log times.
I've also fiddled with the lastlog command to no avail.
View 2 Replies
View Related
Feb 18, 2010
Suppose I have the following files:
1132_1_fr.mp3
1132_2_fr.mp3
1132_3_fr.mp3
.
.
.
1132_3_fr.mp3
[Code].....
So I want to add PD_ to those who dont have this preindex and get rid of _fr.
basically rename files in a same directory!!
View 6 Replies
View Related