9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Ok, so I'm playing around with delimters and reading files. and I came across this behaviour that I thought was a bit odd, regarding how the set command takes values... If I run this: IFS=$'-' #Assigns the - as the default delimiter for bash set I-love-my-gf-a-lot #uses set to put a bunch of... (1 Reply)
Discussion started by: Lost in Cyberia
1 Replies
2. Shell Programming and Scripting
Hi
I have a requirement like
# e=`ls | grep -e"test" | awk -F " " '{print $1}'`
(0) root @ ptxfv3: /
# echo $e
test test.xml
From this i need to grep the word "test" alone i.e., it is occuring twice I need only one among them
Please help (6 Replies)
Discussion started by: Priya Amaresh
6 Replies
3. Shell Programming and Scripting
Dear all,
I have a variable called $abc, which the value is something like below,
*** *********** : *****
where * can be anything. I need to remove all but the final characters until last whitespace.
example
grd groupstudy : tutor6/7
becomes tutor6/7
something like
if... (2 Replies)
Discussion started by: tententen
2 Replies
4. Shell Programming and Scripting
Hi folks.
I have this variable called FirstIN that contains something like this: 001,002,003,004...
I am trying to assign the content of this variable into ModifiedIN but with the following format : 001 002 003 004...(changing the commas for spaces)
I thought about using sed but i am not... (17 Replies)
Discussion started by: Stephan
17 Replies
5. UNIX for Dummies Questions & Answers
I have a small doubt that, how to chomp the new line from the bash shell variable value.
In perl, i will do chomp, but how to do it in bash -- shell programming.
When i redirect the date output i have a new line in it, which i would want to remove, how to do ?! (5 Replies)
Discussion started by: thegeek
5 Replies
6. Shell Programming and Scripting
Hi All,
I am trying to replace the value of a xml tag with a new one. But, the existing value in the xml contain leading spaces and I tried to remove that with different sed commands but all in vain.
For replacing the value I wrote the command in BOLD letters below:
bash-3.00$... (3 Replies)
Discussion started by: khedu
3 Replies
7. Shell Programming and Scripting
Hello there,
I have a variable in the form of '/example/file.txt' . I want to remove the ' characters from the beginning and the end so that the my new variable becomes /example/file.txt . How can I do it in a script?
I know this is a fairly easy question, but i wasn't able to implement it. (3 Replies)
Discussion started by: sertansenturk
3 Replies
8. Shell Programming and Scripting
How do I remove or add leading zeroa from a variable. To make variable 10 characters long when adding zeros. (6 Replies)
Discussion started by: toshidas2000
6 Replies
9. UNIX for Advanced & Expert Users
Hi All,
May be this is a very simple question...
$ b=8
$ readonly b
$ echo $b
8
$ b=90
-bash: b: readonly variable
$ unset b
-bash: unset: b: cannot unset: readonly variable
I m not able to change the readonly mode of variable b
Please help me out..
Thanks
Nidhi (2 Replies)
Discussion started by: Nidhi2177
2 Replies