2,029 reputation
410
bio website
location The Netherlands
age
visits member for 1 year, 5 months
seen 14 hours ago

Currently working as system administrator at Bizztravel B.V.. I've earned a bachelor degree in Computer Sciences. Since computing in general is my passion, I try to keep up with the latest development in this field. I'm active on irc.freenode.org and try to contribute to the open source community as much as I can.


Oct
10
revised shell script edited on windows displays unexpected error message
Added details
Oct
10
comment shell script edited on windows displays unexpected error message
@artm That is correct indeed. I know not much about vim functionality, but that is a great thing to know. Thanks!
Oct
10
answered shell script edited on windows displays unexpected error message
Oct
10
comment shell script edited on windows displays unexpected error message
@DanielJensen webmup.com/BBfEo Just created it to demonstrate what was happening! :) Enjoy.
Oct
10
comment shell script edited on windows displays unexpected error message
Use sed -e "s/^M//" -i script or tr -d \\r <script>script1 and run the script1 again using bash -x script1`. When copying from Windows to a linux machine you'll get the CR+LF... and the rest of the story is obvious I guess.
Oct
10
comment shell script edited on windows displays unexpected error message
There you go!. What is $'username@hostname\r' Can you show the script using cat -A script ? Update your question with these details please. Oh and how does your /etc/hosts file look like. Especially the entry which holds the hostname
Oct
10
comment shell script edited on windows displays unexpected error message
Needless to say that this script has not much of a meaning. Did you try to run the script from another terminal? Does the script work when an IP is used instead? What does bash -x script say ?
Oct
10
comment Bash Mysql Command Substitution Login Failure
No problem, I'm not after getting credits really. I'm glad I could help. You can post my comment as answer an mark it as answer yourself.
Oct
9
comment shell for loop with find with filenames containing spaces
As I said, you don't need a for loop there. You have not explained why you'd need a for loop. Unless I'm not understanding your question.
Oct
9
comment Bash Mysql Command Substitution Login Failure
RESULT=$(mysql -u user -p "${PASS}" -h RemoteHostName DBName -e "select count(*) from TableName;") Will work as expected
Oct
9
comment shell for loop with find with filenames containing spaces
You rarely find a for loop and find construction together. I think you want something like find "$POLLDIR" -type f -mmin +1 -exec sh -c 'mv -- "$@" ./target' _ {} + You can use -name flag to specify different extensions etc. No need for the loop at all.
Oct
8
comment Covert a .tar file to .ext3
@peterph true! The -j option is wrong. That should be substituted to -f
Oct
8
comment Covert a .tar file to .ext3
I think he wants dd as in tar -jxv /path/to/rootfs.tar | dd of=/dev/sdX conv=sync,noerror bs=xxxK where bs=xxxK is the number you used to tar the root fs.
Oct
8
comment bash syntax error near unexpected token `(' - but everything looks like it should work
put a shopt -s extglob just before cp.. command and you'll be just fine
Oct
8
revised File tranfer from the server
removing username shown in answer.
Oct
8
suggested approved edit on File tranfer from the server
Sep
24
awarded  Autobiographer
Sep
23
comment scp with password and renaming the file
@Vasu Then you'd need file="${1##*/}" Also don't use CAPITALS for var names.
Sep
23
comment scp with password and renaming the file
About todayDateVar It is unnecessary to use all that stuff. You'd just todayDateVar=$(date +%b_%d_%Y) at least if you want to achieve the same result. Also variable FILE.. what are you trying to do with it? Removing the slash?
Aug
27
comment Suppressing “sudo: sorry, a password is required to run sudo”
Normally that should have worked. See mywiki.wooledge.org/BashFAQ/… which explains everything about file descriptors including portability