You are not logged in.
Pages: 1
Hi
I am trying to get rid of " " in a txt file with sed
although can't get it to work...(i am not very experinced with sed)
anyway, I have a txt file whic looks like this:
"hi" "there" "we" "like" "sed
and I wanna separate everythng so that i can get an output like
hi
there
and so on...
anyone who knows sed that can help me?
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
solved it yself...there were some other errors fooling me
test=`sed 's|"||g' /tmp/.pkglist | awk '{ print $1 }'`
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
echo "hola" "adios"|sed 's/" *"/n/'
Offline
or
echo '"i" "like" "sed" "more"' | sed "s#"##g" | sed "s# #n#g"
i
like
sed
more
:-)
Offline
what if "i like" "sed more"? mine was incomplete, just a show of how to use it
Offline
We can do this all day... :-D
Offline
thanks guys
I have solved that part now...now there are some other problems, but hey, I will take that later :
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
ok, so I have some more problems, not sure wheter they are related to my sed or not
*snippet*
test="/home/cybertron/gui/cat.list"
LIST=`cat $test`
# for app in `cat $PKGS | sed 's|/.*$||g' | uniq` ; do
for app in `sed 's/"//g' $PKGS`; do
CHKLIST="$CHKLIST $app $LIST ON"
done
*/end of snippet*
I have two files, pkg.list and cat.list
what I want is to have my dialog --checklist to show things like this:
[x] program description
whereas program is my pkg.list and description is cat.list
hopefully you understand what I am trying to do?!!
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
Not entirely sure I understand this but I think you're looking for the 'paste' command which writes corresponding lines of multiple files to one output line. For example:
> cat -n f1
1 f1l1
2 f1l2
3 f1l3
> cat -n f2
1 f2l1
2 f2l2
3 f2l3
> paste -d' ' f1 f2 | cat -n
1 f1l1 f2l1
2 f1l2 f2l2
3 f1l3 f2l3
Hope that helps!
Offline
that sounds like something I can use
I will most certainly try it
thanks !
Update: Doesn't quite do what I want,
I insert my whole code in here:
# INSTEAD OF SHOWING "INSTALL" in the dialog --checklist i wannt it to have a description, how this is done, I don't know...maybe someone does?!
select_install()
{
dodialog msgbox "In the next stage you are going to choose which packages to install, recommendation is that you install all packages." 18 70
CHKLIST=
if [ "$MODE" = "install" ]; then
PKGS=$PKGS_PATH
fi
# INSTEAD OF SHOWING "INSTALL" in the dialog --checklist i wannt it to have a description, how this is done, I don't know...maybe someone does?!
for app in `sed 's|"||g' $PKGS | awk '{ print $1 }'`; do
CHKLIST="$CHKLIST $app INSTALL ON"
done
if [ -e /tmp/.pkglist ]; then
rm /tmp/.pkglist
fi
domenu checklist "Select Packages" 19 55 12 $CHKLIST 2>/tmp/.pkglist || return 1
if [ $? == 0 ]; then
install
else
mainmenu
fi
}
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
Pages: 1