LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-10-2003, 08:31 AM   #1
ipconfig
LQ Newbie
 
Registered: Nov 2003
Location: Israel
Distribution: RedHat
Posts: 9

Rep: Reputation: 0
bash script gone wild


I wrote a small bash script randomjoke that downloads a random joke from bash.org:
Code:
[root@calcium ~]# cat /bin/randomjoke
#! /bin/bash

cat ~/.randomjoke

(lynx --dump bash.org/?random | sed -n -e '/\[12\]/,/\[16\]/p' | grep -v '\[1[26]\]' > ~/.randomjoke &) >& /dev/null
This all works fine when using it from the prompt.
Code:
[root@calcium ~]# cat ~/.randomjoke

   <linux> "So... my girlfriend told me she thought i was a pedophile the
   other day."
   <linux> "so i says to her, that's an awfully big word coming from a 12
   year old."
   <DGF> LOL

[root@calcium ~]#
[root@calcium ~]# (lynx --dump bash.org/?random | sed -n -e '/\[12\]/,/\[16\]/p' | grep -v '\[1[26]\]' > ~/.randomjoke &) >& /dev/null
But when I try /bin/randomjoke it hangs for a long while, then gives me a whole lot of error messages:
Code:
[root@calcium ~]# /bin/randomjoke
/bin/bash: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: Error 23
/bin/bash: /usr/bin/id: Too many open files in system
/bin/bash: /usr/bin/id: Too many open files in system
/bin/bash: /usr/bin/id: Too many open files in system
/bin/bash: [: too many arguments
/bin/bash: /usr/bin/tput: Too many open files in system
/bin/bash: pipe error: Too many open files in system
/bin/bash: [: : integer expression expected
/bin/bash: /usr/bin/dircolors: Too many open files in system
/bin/bash: /bin/grep: Too many open files in system

   Anonymous: Ramadan is over, i can eat!!!
   Anonymous2: I was surfing the internet and i found a page that said
   more women go for guys that are/were in the Air Force then any other
   profession.
   Anonymous: Really, I wanna join the air force one day.
   Anonymous2: Wat, so u could learn how to fly planes into skyscrapers.
   Anonymous: Fool, you're muslim too.
   Anonymous: You r a disgrace to brown pple.
   Anonymous2: Don't be silly i'm not brown, i'm just a really tanned
   white person.

id: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
id: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
id: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
/bin/bash: [: too many arguments
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: : integer expression expected
/bin/randomjoke: /bin/randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
unknown terminal "xterm"
/bin/bash: /usr/bin/tput: Too many open files in system
wc: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
/bin/bash: [: : integer expression expected
dircolors: `/etc/DIR_COLORS': Too many open files in system
cut: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
cut: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
cat: /root/.randomjoke: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: too many arguments
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: : integer expression expected
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: pipe error: Too many open files in system
cat: /root/.randomjoke: Too many open files in system
/bin/bash: /bin/cut: Too many open files in system
/bin/bash: /bin/cut: Too many open files in system
cat: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: too many arguments
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: : integer expression expected
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: pipe error: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
id: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
id: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
id: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
/bin/bash: [: too many arguments
tput: error while loading shared libraries: libncurses.so.5: cannot open shared object file: Error 23
/bin/bash: /usr/bin/tput: Too many open files in system
wc: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
/bin/bash: [: : integer expression expected
dircolors: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
grep: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
/sbin/consoletype: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
id: cannot find name for group ID 0
id: cannot find name for user ID 0
cat: /root/.randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
cat: /root/.randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
tput: error while loading shared libraries: libncurses.so.5: cannot open shared object file: Error 23
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
cut: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
cut: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
cut: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
cat: /root/.randomjoke: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: too many arguments
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: [: : integer expression expected
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: pipe error: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system
cat: /root/.randomjoke: Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
tput: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 23
dircolors: `/etc/DIR_COLORS': Too many open files in system
id: cannot find name for group ID 0
id: cannot find name for user ID 0
id: cannot find name for group ID 0
id: cannot find name for user ID 0
dircolors: `/etc/DIR_COLORS': Too many open files in system

[root@calcium ~]#
What could be the cause of such a thing?
 
Old 12-10-2003, 12:18 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Re: bash script gone wild

Quote:
Originally posted by ipconfig
I wrote a small bash script randomjoke that downloads a random joke from bash.org:
Code:
[root@calcium ~]# cat /bin/randomjoke
#! /bin/bash

cat ~/.randomjoke

(lynx --dump bash.org/?random | sed -n -e '/\[12\]/,/\[16\]/p' | grep -v '\[1[26]\]' > ~/.randomjoke &) >& /dev/null
No idea, works here ;)


Cheers,
Tink
 
Old 12-10-2003, 02:53 PM   #3
ipconfig
LQ Newbie
 
Registered: Nov 2003
Location: Israel
Distribution: RedHat
Posts: 9

Original Poster
Rep: Reputation: 0
Never mind, I guess.
I did all that coding from work via VNC...
I got home and now it works.
Superodd, isn't it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox gone wild hanasi Linux - Software 17 08-07-2005 10:19 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
bash script - incrementing a filename in a script tslinux Programming 10 08-05-2003 11:58 PM
bash script prob: how can i tell the script that a 'dd' has finished? Frustin Linux - General 2 04-02-2003 05:34 AM
mldonkey gone wild crashmeister Linux - Software 0 11-15-2002 09:49 AM


All times are GMT -5. The time now is 09:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration