10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Thank you in advance for looking at this, I've scoured the internet and can't find the answer I'm looking for!! - I am new at bash script so please bare with me!!
I have a script where I've identified individual files within a folder, the filename is then stored as a variable ($filename):... (3 Replies)
Discussion started by: paperbackwriter
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
when I do cat for kernel parameters
cat /proc/sys/kernel/sem >> /etc/sysctl.conf
4096 4096 32 128
The above command working with out any doubt
but I want to pass it like below, need to append "kernel.sem =" and pass it to /etc/sysctl.conf kernel.sem = 4096... (2 Replies)
Discussion started by: stew
2 Replies
3. UNIX for Dummies Questions & Answers
Hi Guys
This is my first post so I am not sure how things go here. I'm sorry if I'm breaking the rule or something. Feel free to correct me about that :)
So as I was saying...
I'd been trying to grep this folder containing 900,000 txt files but seems no luck. I get either "No such file... (6 Replies)
Discussion started by: Nexeu
6 Replies
4. Shell Programming and Scripting
MyFile contains:
ALTER TABLE $DBN.$TBN
ADD $COL $TYP COMPRESS ($VAL);
I need to cat the file and have it substitute all of the variables with their contents. cat MyFile does not work. The following works for the first line, but errors on the second line because of the paren:
$ while read... (2 Replies)
Discussion started by: Phil27577
2 Replies
5. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies
6. Shell Programming and Scripting
Hello everyone,
My problem looks quite simple , how to assign a string with spaces and lines "\n" to a variable.
I've tried all kind of quoting and is impossible, bash always try to execute the string and never executes a simple assignation.
This is part of the code
... (1 Reply)
Discussion started by: trutoman
1 Replies
7. Shell Programming and Scripting
Hi
I'm new in the Shell world, and I've been trying the whole day to get my script to work.
I'm under Ubuntu 10.04.
Let me explain:
I want to list all the files matching some regex in a directory, and then make some some string replacement on the name of the files, and then a cat on the... (2 Replies)
Discussion started by: albh
2 Replies
8. Shell Programming and Scripting
Hi ,
I have below file with 13 columns. I need 2-13 columns seperated by comma and I want to append each row with a string "INSERT INTO xxx" in the begining as 1st column and then a variable "$node" and then $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13 and at the end another string " ; COMMIT;"
... (4 Replies)
Discussion started by: Vaddadi
4 Replies
9. Shell Programming and Scripting
I have a file with a single filename in it, which I want to assign to a BASH variable, so I've been trying:
c=$(head -1 somefile)
echo $c
which outputs correctly, but them when I do
...
somecommand $c
it says it can't find the file, is that because it's grabbing the whole line, and... (5 Replies)
Discussion started by: unclecameron
5 Replies
10. UNIX for Dummies Questions & Answers
I have a question to do and it's somewhat confusing. It says, and I quote
"Create a file called file_1 with three lines of text in it. Create a shell variable called "f_name", assign it the string "file_1". Use the cat command and the variable "f_name" to display the contents of the file... (3 Replies)
Discussion started by: MaestroRage
3 Replies