10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Consider the code snippet below:
fun()
{
while read x
do
echo $x
done < somefile_that_does_not_exists
}
fun
echo I am here
Korn shell on HPUX prints the message "I am here", while the behaviour is different on AIX korn shell. We do not get the message on AIX. Any... (5 Replies)
Discussion started by: 116@434
5 Replies
2. Shell Programming and Scripting
A file contains: abcdef
I need : a b c d e f
It's easy with sed
sed 's/./& /g'but this is embedded linux that doesn't have sed/awk. The shell is unknown but it's bashlike. Parameter expansion works and seems promising and. A question mark seems to work as a wildcard, but there doesn't seem... (5 Replies)
Discussion started by: fubaya
5 Replies
3. Shell Programming and Scripting
Greetings.
I am trying to do a script that will do some file copying for me. Unfortunately I have spaces in the directory names (which I cannot change) and the result is someone hard to achieve in shell scripts. I have searched everywhere on the web but does not manage to find the answer to... (3 Replies)
Discussion started by: Mr.Glaurung
3 Replies
4. Shell Programming and Scripting
Hi,
I did the following script:
DIR=`pwd`;for i in `find . -name GESTION -type d`;do cd $i/..;setfacl -R -m g:directores:rwx,
GESTION;echo $DIR'/'$i;cd $DIR;done
This code do the following actions:
1. Starting inside a folder, it's searching for any folder called "GESTION"
2. Every time... (3 Replies)
Discussion started by: argie01
3 Replies
5. Shell Programming and Scripting
I have to pass a sentence in a file, the specs are as:
cat run | sed 's/SRT/'$8'/g' | sed 's/plength/68/g' | sed 's/stcol/'$5'/g' | sed 's/encol/'$6'/g' | sed 's/brdtype/'$1'/g' | sed 's/brdtxt/'$3'/g' | sed 's/demotxt/Total '$2'/g' | sed 's/bantxt/ban_'$7'/g' | sed 's/validcodes/'$4'/g' >... (15 Replies)
Discussion started by: patilrakesh1984
15 Replies
6. UNIX for Dummies Questions & Answers
Hi
Don't know if this is a dummy question, but let's give it a try.
I yesterday had a problem with undefined behaviour in the sort shell command (I'm using bash), leading to different sort orders without apparent reasons. I resolved this by typing
export LC_ALL="C"
export LC_COLLATE="C"... (5 Replies)
Discussion started by: jossojjos
5 Replies
7. Shell Programming and Scripting
I'm a beginner and wasn't able to google my problem...
I would like to pass a string with spaces to a shell script.
my test_shell:
#!/bin/sh -vx
#######################################################
# generate_documentation (c) Ch.Affolter Nov. 2009 Version 1.0 #... (3 Replies)
Discussion started by: vivelafete
3 Replies
8. UNIX for Advanced & Expert Users
am get a value like ' 15' in a variable
what is the easiest method i can follow to strip 15 out (3 Replies)
Discussion started by: anumkoshy
3 Replies
9. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies
10. Shell Programming and Scripting
hello
whats the difference between excuting a shell script as
a)sh myscript.sh
b). ./myscript.sh
i noticed that my shell script works fine when i run it as . ./myscript
.sh but fails when i run it as sh myscript.sh could anybody explain why.
the shell script is very simple
... (9 Replies)
Discussion started by: xiamin
9 Replies