General :: Run Part Of A Bash Script From Within Another?
May 4, 2010I have two scripts, one of which is very long (around 11000 lines), and i need to run this two lines at a time within the other script. Is there any way to do this?
View 2 RepliesI have two scripts, one of which is very long (around 11000 lines), and i need to run this two lines at a time within the other script. Is there any way to do this?
View 2 RepliesI've a string "this.is.a.name", and I would like to return "is.a.name". How can I do that in bash?
View 3 Replies View RelatedI would like to return the last part of a string in an array of strings in bash.
The array contains in each position the content below:
Code:
a.b.c
a.d.f
a
a.d
[Code].....
Here's the bash script:
Code:
FILES="/usr/sbin/accept
/usr/sbin/pwck
/usr/sbin/chroot
/usr/bin/fakefile
[code]....
Notice the extra" file size" lines in there? What's causing that? I'm trying to learn more bash skills. I have no experience with awk because I have been unable to understand it's basic necessity. But I thought maybe if I try it with some test scripts I might become more interested in using it more and expand my very limited capabilities.
If I have files named like this:
abc_one.c
egx_two.c
tsf_two.c
[code]...
I just used dd to clone a linux partition to a new hard drive, it had 800mb left on the old hard drive, after dd, new hard drive lists 1.29/1.3 terabytes full. Is this what happens by default in dd? How can I fix this?
View 1 Replies View RelatedI'm trying to figure out how to access the local part and the domain part of an email address in postfix's main.cf. For example, myname@mydomain.net has myname as the local part and mydomain.net as the domain part.I get the whole email address with %s. I want to speed up the lookups by writing better database queries.I've had no luck finding this in the otherwise well documented postfix.
View 2 Replies View Relatedwe have access to one domain name , 1 internet ip address and may servers hosting different part of site. I want them all to be accessed via same web site . some of the server in our network are embedded devices.they have their specific utility being hosted on that machine. So the severs are bound to be distributed . I just wanted to know how can I access them via single ip, domain name.
View 6 Replies View RelatedIn bootseqence of linux, the first step is check the CMOSRAM(size 64bytes) setup for custmor setting. So i am just confused wether CMOSRAM is a part of motherboard or is a part of RAM itself.
View 4 Replies View Relatedwould the following command wipe an entire drive clean (partition table included)? Code: dd if=/dev/urandom of=/dev/sda bs=512.I was wondering what the 'bs' part means? Would it be better to omit that?
View 13 Replies View Relatedlets say there is one very big file on some server and i just want to download first 1MB. How can I do it on Linux ?
View 2 Replies View RelatedI would like to remove a part from wiz_khalifa-black_&_yellow-(82_bpm).mp3
The part to be removed is -(*_bpm)
so that makes wiz_khalifa-black_&_yellow.mp3
Also a problem is that sometimes multiple "(" occur in a filename (wiz_khalifa-black_&_yellow-(remix)-(82_bpm)), so how can i only remove from the last "("
I have just re transcoded a bunch of avi's. to tell the new ones from the old ones I put '[xvid]' at the end of all the new avi's. but now I have deleated the old avi's I want to remove the [xvid] part of the file name. This is what I have so far
Code:
#!/bin/bash
for name in *.avi
do
newname=`echo "$name" | tr -d [xvid]`
[Code]...
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
Though I have little experience in the past, i just can't get to work what i have in mind.i want to display part of an output stream.
cat sample.xml
<packet or="recv" ljid="d.sample@test.local/" ts="20110204T15:02:55"><message from='j.sample2@test.local/' to='d.sample@test.local' type='chat' xml:lang='en' id='sd61'>
[code]...
I'm learning a foreign language. There are several online sites that have Flash video in the language I'm learning (e.g., Hulu), which is great. Unfortunately, they have English subtitles, which is (depending on who you ask) somewhere between "annoying" and "actively harmful to my learning".When I'm watching them in a window, I can just move them near the bottom of the screen, or put another window over them. That's awkward, but it kind of works.But I'd like to watch them full-screen, on my TV set. Full-screen Flash doesn't let me put any window on top of it.Is there a way to watch an online Flash video but block out part of it?
View 3 Replies View RelatedIs there a way to color particular words printed on console based on user preference? For example I need to color text 'error' when a particular program is compiled.
View 2 Replies View RelatedI have a dd image of a full drive (as a file) that was using Truecrypt system encryption under windows. I want to mount the main partition from that image using Linux's Truecrypt. I am familiar with dd loopback devices and have the partition offset, but I don't know how I can mount it like this because I need to use the truecrypt command.
Is there perhaps some way to create a fake device file for the disk image that I can mount from within Truecrypt?
I kept bumping into it all the time, only now when I need it I can't find it anywhere! What architecture is the kernel of my machine?
2.6.18-194.el5
I want to read values from a file...these are basically one word values, that is to say that the text file I want to read from contains lines of word length 1, as in:
word1
word2
word3
[code]...
I am using wget to download files from a HTTPS site.My command goes as below. I have used * as wildcard to denote anything can be there between underscore and ".". Please advise on how to solve this./usr/sfw/bin/wget --no-check-certificate --user=LTSTSSB --password=pass -O temp.txt https://234.123.432.33:444/Reporting/File-To-Get_*.xml
View 1 Replies View RelatedI loaded a distro (which does not seem relevant) onto my laptop and used it for a while. Applications did whatever they do creating and saving files. I know that I have images and documents and videos and music and such on the laptop among other non-distro data files. Is there a simple (straightforward) way to identify which files on disk are NOT part of the installed distro? I know how to use find. I know that find lets me locate files based on some date-time-stamp. I know, too, that I can use any selected file as a benchmark date-time instead of some specific command line string.
For example:
Code:
Find files whose modification date is before (or after) the date(s) associated with the file /path/foo.bar.
Is there any one file that I could use to peg the distro install date? Can I get that date from somewhere else like a file system details?
What I want to achieve is, if I have following in my file:
x y
X z
I should be able to find the pair, x Y and replace it with x a. So, basically I want to search for case sensitive 'x' but search and replace case insensitive 'y'. How should I do it? Can this be achieved with 'sed' command?
I have applied a patch in linux kernel version-2.6.31(fedora core 12)source code.Now I want to check whether the performance of the memory management part has been enhanced. So how to test the efficiency of this new modified code?
View 1 Replies View RelatedI need a webserver (LAMP) running inside a virtual machine (#1) running as a service (#2) in headless mode (#3) with part or the whole file system encrypted (#4).The virtual machine will be started with no user intervention and provide access to a web application for users in the host machine. Points #1,#2 and #3 are checked and proved to be working fine with Sun VirtualBox, so my question is for #4:Can I encrypt all of the file system and still access the webserver (using a browser) or will GRUB ask me for a password?If encrypting all of the file system is not an option, can I encrypt only /home and /var/www? Will Apache/PHP be able to use files in /home or /var/www without asking for a password or mounting these partitions manually?
View 2 Replies View RelatedI have many files in a folder for example
Kiran.txt
Kiran1.txt
Kiran221.txt
Kiran144.txt
Time.csv
[Code]...
From this directory, I want to know how I could use grep to display files based on part of their filename - for example those starting with "Account" or those ending in ".sh".
Whenever I start debian it runs fine until it gets to the DHCP part.It completley stops and spends like three minutes with stuff like
Code:
DHCP Request on port 57 interval 4
DHCP Request on port 57 interval 14
[code]....
I typed in a XTerm in IceWM(knowing I don't have permissions):
[code]...
I can't access that folder with these permissions. Why would it place it in such a folder?! What is in this file? What part of the system is responsible for this/ where do I turn this off?
I have a procedure say X
output of X is :
Fund name: Mutual
NAV is: 1234
So I appended this output into a file using shellscript. But now my requirement is changed. The part of output like Fund name and 1234 should be in bold. How can I do this using shell script.